Changeset 135881 in webkit


Ignore:
Timestamp:
Nov 27, 2012, 10:52:30 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.
https://bugs.webkit.org/show_bug.cgi?id=102452

Patch by Eberhard Graether <egraether@google.com> on 2012-11-27
Reviewed by Pavel Feldman.

This change makes the showPaintRects setting in the Web Inspector's settings notify InspectorClient
when changed. And the default paint rects drawing is not used if an alternative is available.
This allows Chromium to draw the paint rects in the compositor's HUDLayer.

Source/Platform:

  • chromium/public/WebLayerTreeView.h:

(WebLayerTreeView):
(WebKit::WebLayerTreeView::setShowPaintRects):

Source/WebCore:

No new tests.

  • inspector/InspectorClient.h:

(WebCore::InspectorClient::overridesShowPaintRects):
(WebCore::InspectorClient::setShowPaintRects):
(InspectorClient):

  • inspector/InspectorPageAgent.cpp:

(PageAgentState):
(WebCore::InspectorPageAgent::restore):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::setShowPaintRects):
(WebCore::InspectorPageAgent::didPaint):

Source/WebKit/chromium:

  • public/WebView.h:

(WebView):

  • src/InspectorClientImpl.cpp:

(WebKit::InspectorClientImpl::overridesShowPaintRects):
(WebKit):
(WebKit::InspectorClientImpl::setShowPaintRects):

  • src/InspectorClientImpl.h:

(InspectorClientImpl):

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::setShowPaintRects):
(WebKit):

  • src/WebViewImpl.h:

(WebViewImpl):

Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/Platform/ChangeLog

    r135860 r135881  
     12012-11-27  Eberhard Graether  <egraether@google.com>
     2
     3        Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.
     4        https://bugs.webkit.org/show_bug.cgi?id=102452
     5
     6        Reviewed by Pavel Feldman.
     7
     8        This change makes the showPaintRects setting in the Web Inspector's settings notify InspectorClient
     9        when changed. And the default paint rects drawing is not used if an alternative is available.
     10        This allows Chromium to draw the paint rects in the compositor's HUDLayer.
     11
     12        * chromium/public/WebLayerTreeView.h:
     13        (WebLayerTreeView):
     14        (WebKit::WebLayerTreeView::setShowPaintRects):
     15
    1162012-11-27  Keishi Hattori  <keishi@webkit.org>
    217
  • trunk/Source/Platform/chromium/public/WebLayerTreeView.h

    r134669 r135881  
    183183    virtual void setShowFPSCounter(bool) { }
    184184
     185    // Toggles the paint rects in the HUD layer
     186    virtual void setShowPaintRects(bool) { }
     187
    185188    // Provides a font atlas to use for debug visualizations. The atlas must be a bitmap containing glyph data, a table of
    186189    // ASCII character values to a subrectangle of the atlas representing the corresponding glyph, and the glyph height.
  • trunk/Source/WebCore/ChangeLog

    r135876 r135881  
     12012-11-27  Eberhard Graether  <egraether@google.com>
     2
     3        Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.
     4        https://bugs.webkit.org/show_bug.cgi?id=102452
     5
     6        Reviewed by Pavel Feldman.
     7
     8        This change makes the showPaintRects setting in the Web Inspector's settings notify InspectorClient
     9        when changed. And the default paint rects drawing is not used if an alternative is available.
     10        This allows Chromium to draw the paint rects in the compositor's HUDLayer.
     11
     12        No new tests.
     13
     14        * inspector/InspectorClient.h:
     15        (WebCore::InspectorClient::overridesShowPaintRects):
     16        (WebCore::InspectorClient::setShowPaintRects):
     17        (InspectorClient):
     18        * inspector/InspectorPageAgent.cpp:
     19        (PageAgentState):
     20        (WebCore::InspectorPageAgent::restore):
     21        (WebCore::InspectorPageAgent::disable):
     22        (WebCore::InspectorPageAgent::setShowPaintRects):
     23        (WebCore::InspectorPageAgent::didPaint):
     24
    1252012-11-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    226
  • trunk/Source/WebCore/inspector/InspectorClient.h

    r134542 r135881  
    7373    }
    7474
     75    virtual bool overridesShowPaintRects() { return false; }
     76    virtual void setShowPaintRects(bool) { }
     77
    7578    virtual bool canShowFPSCounter() { return false; }
    7679    virtual void setShowFPSCounter(bool) { }
  • trunk/Source/WebCore/inspector/InspectorPageAgent.cpp

    r135571 r135881  
    9494static const char pageAgentFitWindow[] = "pageAgentFitWindow";
    9595static const char pageAgentShowFPSCounter[] = "pageAgentShowFPSCounter";
    96 static const char showPaintRects[] = "showPaintRects";
     96static const char pageAgentShowPaintRects[] = "pageAgentShowPaintRects";
    9797#if ENABLE(TOUCH_EVENTS)
    9898static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled";
     
    360360        bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgentScriptExecutionDisabled);
    361361        setScriptExecutionDisabled(0, scriptExecutionDisabled);
     362        bool showPaintRects = m_state->getBoolean(PageAgentState::pageAgentShowPaintRects);
     363        setShowPaintRects(0, showPaintRects);
    362364        bool showFPSCounter = m_state->getBoolean(PageAgentState::pageAgentShowFPSCounter);
    363365        setShowFPSCounter(0, showFPSCounter);
     
    394396
    395397    setScriptExecutionDisabled(0, false);
     398    setShowPaintRects(0, false);
    396399    setShowFPSCounter(0, false);
    397400
     
    726729void InspectorPageAgent::setShowPaintRects(ErrorString*, bool show)
    727730{
    728     m_state->setBoolean(PageAgentState::showPaintRects, show);
    729     if (!show)
    730         m_page->mainFrame()->view()->invalidate();
     731    m_state->setBoolean(PageAgentState::pageAgentShowPaintRects, show);
     732    m_client->setShowPaintRects(show);
     733
     734    if (!show && mainFrame() && mainFrame()->view())
     735        mainFrame()->view()->invalidate();
    731736}
    732737
     
    910915void InspectorPageAgent::didPaint(GraphicsContext* context, const LayoutRect& rect)
    911916{
    912     if (!m_enabled || !m_state->getBoolean(PageAgentState::showPaintRects))
     917    if (!m_enabled || m_client->overridesShowPaintRects() || !m_state->getBoolean(PageAgentState::pageAgentShowPaintRects))
    913918        return;
    914919
  • trunk/Source/WebKit/chromium/ChangeLog

    r135877 r135881  
     12012-11-27  Eberhard Graether  <egraether@google.com>
     2
     3        Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.
     4        https://bugs.webkit.org/show_bug.cgi?id=102452
     5
     6        Reviewed by Pavel Feldman.
     7
     8        This change makes the showPaintRects setting in the Web Inspector's settings notify InspectorClient
     9        when changed. And the default paint rects drawing is not used if an alternative is available.
     10        This allows Chromium to draw the paint rects in the compositor's HUDLayer.
     11
     12        * public/WebView.h:
     13        (WebView):
     14        * src/InspectorClientImpl.cpp:
     15        (WebKit::InspectorClientImpl::overridesShowPaintRects):
     16        (WebKit):
     17        (WebKit::InspectorClientImpl::setShowPaintRects):
     18        * src/InspectorClientImpl.h:
     19        (InspectorClientImpl):
     20        * src/WebViewImpl.cpp:
     21        (WebKit::WebViewImpl::setShowPaintRects):
     22        (WebKit):
     23        * src/WebViewImpl.h:
     24        (WebViewImpl):
     25
    1262012-11-27  Tony Chang  <tony@chromium.org>
    227
  • trunk/Source/WebKit/chromium/public/WebView.h

    r134542 r135881  
    472472    virtual bool isSelectionEditable() const = 0;
    473473
     474    virtual void setShowPaintRects(bool) = 0;
    474475    virtual void setShowFPSCounter(bool) = 0;
    475476
  • trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp

    r134542 r135881  
    164164}
    165165
     166bool InspectorClientImpl::overridesShowPaintRects()
     167{
     168    return m_inspectedWebView->isAcceleratedCompositingActive();
     169}
     170
     171void InspectorClientImpl::setShowPaintRects(bool show)
     172{
     173    m_inspectedWebView->setShowPaintRects(show);
     174}
     175
    166176bool InspectorClientImpl::canShowFPSCounter()
    167177{
  • trunk/Source/WebKit/chromium/src/InspectorClientImpl.h

    r134542 r135881  
    7878    virtual void autoZoomPageToFitWidth();
    7979
     80    virtual bool overridesShowPaintRects();
     81    virtual void setShowPaintRects(bool);
     82
    8083    virtual bool canShowFPSCounter();
    8184    virtual void setShowFPSCounter(bool);
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r135801 r135881  
    849849}
    850850
     851void WebViewImpl::setShowPaintRects(bool show)
     852{
     853    if (isAcceleratedCompositingActive()) {
     854        TRACE_EVENT0("webkit", "WebViewImpl::setShowPaintRects");
     855        m_layerTreeView->setShowPaintRects(show);
     856    }
     857    settingsImpl()->setShowPaintRects(show);
     858}
     859
    851860bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
    852861{
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r135801 r135881  
    310310    virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
    311311    virtual WebViewBenchmarkSupport* benchmarkSupport();
     312    virtual void setShowPaintRects(bool);
    312313    virtual void setShowFPSCounter(bool);
    313314
Note: See TracChangeset for help on using the changeset viewer.