Changeset 212172 in webkit


Ignore:
Timestamp:
Feb 10, 2017 6:30:23 PM (7 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=168054

Reviewed by Tim Horton.

Source/WebCore:

When adding mask layers, there was an ordering dependency. There was a hack in GraphicsLayerCA::setVisibleAndCoverageRects()
to propagate m_intersectsCoverageRect to masks. However, if GraphicsLayerCA::setVisibleAndCoverageRects()
ran on the masked layer before the mask was added, nothing updated the "m_intersectsCoverageRect" state of the mask layer.

Fix by explicitly calling setVisibleAndCoverageRects() on the mask layer, passing the same rects and
viewport-constrained state as for its host layer (we already assume that their geometry matches).

Tested by compositing/masks/solid-color-masked.html

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):

LayoutTests:

Make the timeout 10ms so the test consistently fails with the old code.

  • compositing/masks/solid-color-masked.html:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r212168 r212172  
     12017-02-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=168054
     5
     6        Reviewed by Tim Horton.
     7
     8        Make the timeout 10ms so the test consistently fails with the old code.
     9
     10        * compositing/masks/solid-color-masked.html:
     11
    1122017-02-10  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/LayoutTests/compositing/masks/solid-color-masked.html

    r170306 r212172  
    1111       
    1212        .composited {
    13           -webkit-transform: translateZ(0);
     13          transform: translateZ(0);
    1414        }
    1515
     
    2727                if (window.testRunner)
    2828                    testRunner.notifyDone();
    29             }, 0);
     29            }, 10);
    3030        }
    3131        window.addEventListener('load', doTest, false);
  • trunk/Source/WebCore/ChangeLog

    r212170 r212172  
     12017-02-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=168054
     5
     6        Reviewed by Tim Horton.
     7
     8        When adding mask layers, there was an ordering dependency. There was a hack in GraphicsLayerCA::setVisibleAndCoverageRects()
     9        to propagate m_intersectsCoverageRect to masks. However, if GraphicsLayerCA::setVisibleAndCoverageRects()
     10        ran on the masked layer before the mask was added, nothing updated the "m_intersectsCoverageRect" state of the mask layer.
     11
     12        Fix by explicitly calling setVisibleAndCoverageRects() on the mask layer, passing the same rects and
     13        viewport-constrained state as for its host layer (we already assume that their geometry matches).
     14
     15        Tested by compositing/masks/solid-color-masked.html
     16
     17        * platform/graphics/ca/GraphicsLayerCA.cpp:
     18        (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
     19        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
     20
    1212017-02-10  Commit Queue  <commit-queue@webkit.org>
    222
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r211750 r212172  
    13331333        m_uncommittedChanges |= CoverageRectChanged;
    13341334        m_intersectsCoverageRect = intersectsCoverageRect;
    1335 
    1336         if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
    1337             maskLayer->m_uncommittedChanges |= CoverageRectChanged;
    1338             maskLayer->m_intersectsCoverageRect = intersectsCoverageRect;
    1339         }
    13401335    }
    13411336
     
    13431338        m_uncommittedChanges |= CoverageRectChanged;
    13441339        m_visibleRect = rects.visibleRect;
    1345 
    1346         if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
    1347             // FIXME: this assumes that the mask layer has the same geometry as this layer (which is currently always true).
    1348             maskLayer->m_uncommittedChanges |= CoverageRectChanged;
    1349             maskLayer->m_visibleRect = rects.visibleRect;
    1350         }
    13511340    }
    13521341
     
    13541343        m_uncommittedChanges |= CoverageRectChanged;
    13551344        m_coverageRect = rects.coverageRect;
    1356 
    1357         if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
    1358             maskLayer->m_uncommittedChanges |= CoverageRectChanged;
    1359             maskLayer->m_coverageRect = rects.coverageRect;
    1360         }
    13611345    }
    13621346}
     
    14241408    childCommitState.ancestorIsViewportConstrained |= m_isViewportConstrained;
    14251409
    1426     if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer))
     1410    if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) {
     1411        maskLayer->setVisibleAndCoverageRects(rects, m_isViewportConstrained || commitState.ancestorIsViewportConstrained);
    14271412        maskLayer->commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition);
     1413    }
    14281414
    14291415    const Vector<GraphicsLayer*>& childLayers = children();
Note: See TracChangeset for help on using the changeset viewer.