Changeset 96160 in webkit


Ignore:
Timestamp:
Sep 27, 2011 2:47:30 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Add a mechanism to test for the compositing tree mutated during painting
https://bugs.webkit.org/show_bug.cgi?id=68738

Patch by James Robinson <jamesr@chromium.org> on 2011-09-27
Reviewed by Adam Barth.

Source/WebCore:

Sets a static bool during GraphicsLayer::paintGraphicsLayerContents and ASSERT()s that we never create or
destroy a GraphicsLayer inside this function. Painting should never mutate the GraphicsLayer tree.

Test: compositing/video/video-with-invalid-source.html

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::~GraphicsLayer):
(WebCore::GraphicsLayer::paintGraphicsLayerContents):

LayoutTests:

Adds a test that caused compositing to be disabled during painting before r95863 due to a video load failing.

  • compositing/video/video-with-invalid-source-expected.txt: Added.
  • compositing/video/video-with-invalid-source.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96159 r96160  
     12011-09-27  James Robinson  <jamesr@chromium.org>
     2
     3        Add a mechanism to test for the compositing tree mutated during painting
     4        https://bugs.webkit.org/show_bug.cgi?id=68738
     5
     6        Reviewed by Adam Barth.
     7
     8        Adds a test that caused compositing to be disabled during painting before r95863 due to a video load failing.
     9
     10        * compositing/video/video-with-invalid-source-expected.txt: Added.
     11        * compositing/video/video-with-invalid-source.html: Added.
     12
    1132011-09-27  Ojan Vafai  <ojan@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r96159 r96160  
     12011-09-27  James Robinson  <jamesr@chromium.org>
     2
     3        Add a mechanism to test for the compositing tree mutated during painting
     4        https://bugs.webkit.org/show_bug.cgi?id=68738
     5
     6        Reviewed by Adam Barth.
     7
     8        Sets a static bool during GraphicsLayer::paintGraphicsLayerContents and ASSERT()s that we never create or
     9        destroy a GraphicsLayer inside this function. Painting should never mutate the GraphicsLayer tree.
     10
     11        Test: compositing/video/video-with-invalid-source.html
     12
     13        * platform/graphics/GraphicsLayer.cpp:
     14        (WebCore::GraphicsLayer::GraphicsLayer):
     15        (WebCore::GraphicsLayer::~GraphicsLayer):
     16        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
     17
    1182011-09-27  Ojan Vafai  <ojan@chromium.org>
    219
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r95901 r96160  
    6262}
    6363
     64#ifndef NDEBUG
     65static bool s_inPaintContents = false;
     66#endif
     67
    6468GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
    6569    : m_client(client)
     
    8589    , m_repaintCount(0)
    8690{
     91    ASSERT(!s_inPaintContents);
    8792}
    8893
    8994GraphicsLayer::~GraphicsLayer()
    9095{
     96    ASSERT(!s_inPaintContents);
    9197    removeAllChildren();
    9298    removeFromParent();
     
    269275void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const IntRect& clip)
    270276{
     277#ifndef NDEBUG
     278    s_inPaintContents = true;
     279#endif
    271280    if (m_client)
    272281        m_client->paintContents(this, context, m_paintingPhase, clip);
     282#ifndef NDEBUG
     283    s_inPaintContents = false;
     284#endif
    273285}
    274286
Note: See TracChangeset for help on using the changeset viewer.