Changeset 252486 in webkit
- Timestamp:
- Nov 15, 2019 8:58:59 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252478 r252486 1 2019-11-15 Simon Fraser <simon.fraser@apple.com> 2 3 The image is flashing if falls out and has an animation transform: rotate 4 https://bugs.webkit.org/show_bug.cgi?id=203613 5 6 Reviewed by Antti Koivisto. 7 8 * compositing/backing/backing-store-attachment-with-rotation-expected.txt: Added. 9 * compositing/backing/backing-store-attachment-with-rotation.html: Added. 10 1 11 2019-11-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r252483 r252486 1 2019-11-15 Simon Fraser <simon.fraser@apple.com> 2 3 The image is flashing if falls out and has an animation transform: rotate 4 https://bugs.webkit.org/show_bug.cgi?id=203613 5 6 Reviewed by Antti Koivisto. 7 8 Code added in r218735 that maps the animation extent through the current animating transform 9 worked for translations, but not rotation where anchor point matters. This matrix 10 needs to take anchor point into account. 11 12 Shared some code that applies anchor point to a matrix. 13 14 Test: compositing/backing/backing-store-attachment-with-rotation.html 15 16 * platform/graphics/ca/GraphicsLayerCA.cpp: 17 (WebCore::GraphicsLayerCA::layerTransform const): 18 (WebCore::GraphicsLayerCA::transformByApplyingAnchorPoint const): 19 (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): 20 * platform/graphics/ca/GraphicsLayerCA.h: 21 1 22 2019-11-15 Zalan Bujtas <zalan@apple.com> 2 23 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r251385 r252486 1375 1375 currentTransform = *m_transform; 1376 1376 1377 if (!currentTransform.isIdentity()) { 1378 FloatPoint3D absoluteAnchorPoint(anchorPoint()); 1379 absoluteAnchorPoint.scale(size().width(), size().height(), 1); 1380 transform.translate3d(absoluteAnchorPoint.x(), absoluteAnchorPoint.y(), absoluteAnchorPoint.z()); 1381 transform.multiply(currentTransform); 1382 transform.translate3d(-absoluteAnchorPoint.x(), -absoluteAnchorPoint.y(), -absoluteAnchorPoint.z()); 1383 } 1377 transform.multiply(transformByApplyingAnchorPoint(currentTransform)); 1384 1378 1385 1379 if (GraphicsLayer* parentLayer = parent()) { … … 1395 1389 1396 1390 return transform; 1391 } 1392 1393 TransformationMatrix GraphicsLayerCA::transformByApplyingAnchorPoint(const TransformationMatrix& matrix) const 1394 { 1395 if (matrix.isIdentity()) 1396 return matrix; 1397 1398 TransformationMatrix result; 1399 FloatPoint3D absoluteAnchorPoint(anchorPoint()); 1400 absoluteAnchorPoint.scale(size().width(), size().height(), 1); 1401 result.translate3d(absoluteAnchorPoint.x(), absoluteAnchorPoint.y(), absoluteAnchorPoint.z()); 1402 result.multiply(matrix); 1403 result.translate3d(-absoluteAnchorPoint.x(), -absoluteAnchorPoint.y(), -absoluteAnchorPoint.z()); 1404 return result; 1397 1405 } 1398 1406 … … 1487 1495 if (auto extent = animationExtent()) { 1488 1496 // Adjust the animation extent to match the current animation position. 1489 bounds = rects.animatingTransform.inverse().valueOr(TransformationMatrix()).mapRect(*extent); 1497 auto animatingTransformWithAnchorPoint = transformByApplyingAnchorPoint(rects.animatingTransform); 1498 bounds = animatingTransformWithAnchorPoint.inverse().valueOr(TransformationMatrix()).mapRect(*extent); 1490 1499 } 1491 1500 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r249511 r252486 307 307 308 308 TransformationMatrix layerTransform(const FloatPoint& position, const TransformationMatrix* customTransform = 0) const; 309 TransformationMatrix transformByApplyingAnchorPoint(const TransformationMatrix&) const; 309 310 310 311 enum ComputeVisibleRectFlag { RespectAnimatingTransforms = 1 << 0 };
Note: See TracChangeset
for help on using the changeset viewer.