Changeset 95365 in webkit


Ignore:
Timestamp:
Sep 16, 2011 9:39:45 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Remove m_contentsDirty from LayerChromium because it
is redundant with m_dirtyRect.
https://bugs.webkit.org/show_bug.cgi?id=68213

Patch by Shawn Singh <shawnsingh@chromium.org> on 2011-09-16
Reviewed by James Robinson.

Code cleanup towards unit testing.

  • platform/graphics/chromium/Canvas2DLayerChromium.cpp:

(WebCore::Canvas2DLayerChromium::updateCompositorResources):

  • platform/graphics/chromium/ContentLayerChromium.cpp:

(WebCore::ContentLayerChromium::paintContentsIfDirty):

  • platform/graphics/chromium/ImageLayerChromium.cpp:

(WebCore::ImageLayerChromium::paintContentsIfDirty):

  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::setNeedsDisplay):
(WebCore::LayerChromium::resetNeedsDisplay):

  • platform/graphics/chromium/LayerChromium.h:
  • platform/graphics/chromium/VideoLayerChromium.cpp:

(WebCore::VideoLayerChromium::updateCompositorResources):

  • platform/graphics/chromium/WebGLLayerChromium.cpp:

(WebCore::WebGLLayerChromium::updateCompositorResources):

Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95362 r95365  
     12011-09-16  Shawn Singh  <shawnsingh@chromium.org>
     2
     3        Remove m_contentsDirty from LayerChromium because it
     4        is redundant with m_dirtyRect.
     5        https://bugs.webkit.org/show_bug.cgi?id=68213
     6
     7        Reviewed by James Robinson.
     8
     9        Code cleanup towards unit testing.
     10
     11        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
     12        (WebCore::Canvas2DLayerChromium::updateCompositorResources):
     13        * platform/graphics/chromium/ContentLayerChromium.cpp:
     14        (WebCore::ContentLayerChromium::paintContentsIfDirty):
     15        * platform/graphics/chromium/ImageLayerChromium.cpp:
     16        (WebCore::ImageLayerChromium::paintContentsIfDirty):
     17        * platform/graphics/chromium/LayerChromium.cpp:
     18        (WebCore::LayerChromium::LayerChromium):
     19        (WebCore::LayerChromium::setNeedsDisplay):
     20        (WebCore::LayerChromium::resetNeedsDisplay):
     21        * platform/graphics/chromium/LayerChromium.h:
     22        * platform/graphics/chromium/VideoLayerChromium.cpp:
     23        (WebCore::VideoLayerChromium::updateCompositorResources):
     24        * platform/graphics/chromium/WebGLLayerChromium.cpp:
     25        (WebCore::WebGLLayerChromium::updateCompositorResources):
     26
    1272011-09-16  Dmitry Lomov  <dslomov@google.com>
    228
  • trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp

    r95114 r95365  
    6767void Canvas2DLayerChromium::updateCompositorResources(GraphicsContext3D*)
    6868{
    69     if (!m_contentsDirty || !drawsContent())
     69    if (m_dirtyRect.isEmpty() || !drawsContent())
    7070        return;
    7171
    72     if (m_contentsDirty) {
    73         if (m_context) {
     72    if (m_context) {
    7473#if USE(SKIA)
    75             GrContext* grContext = m_context->grContext();
    76             if (grContext) {
    77                 m_context->makeContextCurrent();
    78                 grContext->flush();
    79             }
     74        GrContext* grContext = m_context->grContext();
     75        if (grContext) {
     76            m_context->makeContextCurrent();
     77            grContext->flush();
     78        }
    8079#endif
    81             m_context->flush();
    82         }
    83         m_contentsDirty = false;
     80        m_context->flush();
    8481    }
     82    resetNeedsDisplay();
    8583}
    8684
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r95320 r95365  
    111111
    112112    prepareToUpdate(layerRect);
    113     m_dirtyRect = FloatRect();
     113    resetNeedsDisplay();
    114114}
    115115
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r95148 r95365  
    153153        if (!m_dirtyRect.isEmpty()) {
    154154            invalidateRect(paintRect);
    155             m_dirtyRect = IntRect();
     155            resetNeedsDisplay();
    156156        }
    157157    }
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r95348 r95365  
    5959LayerChromium::LayerChromium(CCLayerDelegate* delegate)
    6060    : m_delegate(delegate)
    61     , m_contentsDirty(false)
    6261    , m_layerId(s_nextLayerId++)
    6362    , m_parent(0)
     
    275274    // setNeedsCommit will schedule a fresh compositing pass.
    276275    // For the root layer, setNeedsCommit has no effect.
    277     m_contentsDirty = true;
    278 
    279276    m_dirtyRect.unite(dirtyRect);
    280277    setNeedsCommit();
     
    285282    m_dirtyRect.setLocation(FloatPoint());
    286283    m_dirtyRect.setSize(bounds());
    287     m_contentsDirty = true;
    288284    setNeedsCommit();
    289285}
     
    292288{
    293289    m_dirtyRect = FloatRect();
    294     m_contentsDirty = false;
    295290}
    296291
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r95348 r95365  
    223223
    224224    FloatRect m_dirtyRect;
    225     bool m_contentsDirty;
    226225
    227226    RefPtr<LayerChromium> m_maskLayer;
  • trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp

    r95148 r95365  
    8080void VideoLayerChromium::updateCompositorResources(GraphicsContext3D* context)
    8181{
    82     if (!m_contentsDirty || !m_delegate)
     82    if (m_dirtyRect.isEmpty() || !m_delegate)
    8383        return;
    8484
     
    120120    }
    121121
    122     m_dirtyRect.setSize(FloatSize());
    123     m_contentsDirty = false;
     122    resetNeedsDisplay();
    124123
    125124    m_provider->putCurrentFrame(frame);
  • trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp

    r95148 r95365  
    7171        return;
    7272
    73     if (!m_contentsDirty)
     73    if (m_dirtyRect.isEmpty())
    7474        return;
    7575
     
    8585    }
    8686    // Update the contents of the texture used by the compositor.
    87     if (m_contentsDirty && m_textureUpdated) {
     87    if (!m_dirtyRect.isEmpty() && m_textureUpdated) {
    8888        // prepareTexture copies the contents of the off-screen render target into the texture
    8989        // used by the compositor.
     
    9191        m_context->prepareTexture();
    9292        m_context->markLayerComposited();
    93         m_contentsDirty = false;
     93        resetNeedsDisplay();
    9494        m_textureUpdated = false;
    9595    }
Note: See TracChangeset for help on using the changeset viewer.