Changeset 215750 in webkit
- Timestamp:
- Apr 25, 2017 12:20:17 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215746 r215750 1 2017-04-25 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=171060 5 <rdar://problem/31771174> 6 7 Reviewed by Simon Fraser. 8 9 Accelerated transform animations move underlying layers without invalidating GraphicsLayers. 10 To update tile coverage we need to commit such subtrees even if there are not other changes. 11 12 * platform/graphics/ca/GraphicsLayerCA.cpp: 13 (WebCore::GraphicsLayerCA::GraphicsLayerCA): 14 (WebCore::GraphicsLayerCA::needsCommit): 15 16 Commit subtrees with accelerated transform animations. 17 Factor into a function. 18 19 (WebCore::GraphicsLayerCA::recursiveCommitChanges): 20 21 Track if descendants had any accelerated transform animations after commit. 22 23 * platform/graphics/ca/GraphicsLayerCA.h: 24 (WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations): 25 (WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations): 26 1 27 2017-04-25 Eric Carlson <eric.carlson@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r215469 r215750 391 391 GraphicsLayerCA::GraphicsLayerCA(Type layerType, GraphicsLayerClient& client) 392 392 : GraphicsLayer(layerType, client) 393 , m_needsFullRepaint(false)394 , m_usingBackdropLayerType(false)395 , m_isViewportConstrained(false)396 , m_intersectsCoverageRect(false)397 , m_hasEverPainted(false)398 393 { 399 394 } … … 1411 1406 } 1412 1407 1408 bool GraphicsLayerCA::needsCommit(const CommitState& commitState) 1409 { 1410 if (commitState.ancestorHadChanges) 1411 return true; 1412 if (m_uncommittedChanges) 1413 return true; 1414 if (hasDescendantsWithUncommittedChanges()) 1415 return true; 1416 // Accelerated transforms move the underlying layers without GraphicsLayers getting invalidated. 1417 if (isRunningTransformAnimation()) 1418 return true; 1419 if (hasDescendantsWithRunningTransformAnimations()) 1420 return true; 1421 1422 return false; 1423 } 1424 1413 1425 // rootRelativeTransformForScaling is a transform from the root, but for layers with transform animations, it cherry-picked the state of the 1414 1426 // animation that contributes maximally to the scale (on every layer with animations down the hierarchy). 1415 1427 void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale) 1416 1428 { 1417 if (! commitState.ancestorHadChanges && !m_uncommittedChanges && !hasDescendantsWithUncommittedChanges())1429 if (!needsCommit(commitState)) 1418 1430 return; 1419 1431 … … 1488 1500 const Vector<GraphicsLayer*>& childLayers = children(); 1489 1501 size_t numChildren = childLayers.size(); 1502 1503 bool hasDescendantsWithRunningTransformAnimations = false; 1490 1504 1491 1505 for (size_t i = 0; i < numChildren; ++i) { 1492 1506 GraphicsLayerCA& currentChild = downcast<GraphicsLayerCA>(*childLayers[i]); 1493 1507 currentChild.recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale); 1508 1509 if (currentChild.isRunningTransformAnimation() || currentChild.hasDescendantsWithRunningTransformAnimations()) 1510 hasDescendantsWithRunningTransformAnimations = true; 1494 1511 } 1495 1512 … … 1501 1518 1502 1519 setHasDescendantsWithUncommittedChanges(false); 1520 setHasDescendantsWithRunningTransformAnimations(hasDescendantsWithRunningTransformAnimations); 1503 1521 1504 1522 bool hadDirtyRects = m_uncommittedChanges & DirtyRectsChanged; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r215469 r215750 160 160 bool ancestorIsViewportConstrained { false }; 161 161 }; 162 bool needsCommit(const CommitState&); 162 163 void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false); 163 164 … … 510 511 void noteChangesForScaleSensitiveProperties(); 511 512 513 bool hasDescendantsWithRunningTransformAnimations() const { return m_hasDescendantsWithRunningTransformAnimations; } 514 void setHasDescendantsWithRunningTransformAnimations(bool b) { m_hasDescendantsWithRunningTransformAnimations = b; } 515 512 516 void propagateLayerChangeToReplicas(ScheduleFlushOrNot = ScheduleFlush); 513 517 … … 542 546 543 547 ContentsLayerPurpose m_contentsLayerPurpose { NoContentsLayer }; 544 bool m_needsFullRepaint : 1; 545 bool m_usingBackdropLayerType : 1; 546 bool m_isViewportConstrained : 1; 547 bool m_intersectsCoverageRect : 1; 548 bool m_hasEverPainted : 1; 548 bool m_needsFullRepaint { false }; 549 bool m_usingBackdropLayerType { false }; 550 bool m_isViewportConstrained { false }; 551 bool m_intersectsCoverageRect { false }; 552 bool m_hasEverPainted { false }; 553 bool m_hasDescendantsWithRunningTransformAnimations { false }; 549 554 550 555 Color m_contentsSolidColor;
Note: See TracChangeset
for help on using the changeset viewer.