Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1318)

Unified Diff: third_party/WebKit/Source/core/paint/SVGRootPainter.cpp

Issue 1865093004: Add a transform paint property for local SVG transforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck that SVG does not scroll and describe it in a comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
index 38ebea3c703a63393ffaf90d58d4be354c0624c4..619179fd1365042b2ee5616e541f46aee705675b 100644
--- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
@@ -49,18 +49,24 @@ void SVGRootPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO
PaintInfo paintInfoBeforeFiltering(paintInfo);
- // At the HTML->SVG boundary, SVGRoot will have a paint offset transform
- // paint property but may not have a PaintLayer, so we need to update the
- // paint properties here since they will not be updated by PaintLayer
- // (See: PaintPropertyTreeBuilder::createPaintOffsetTranslationIfNeeded).
- Optional<ScopedPaintChunkProperties> paintOffsetTranslationPropertyScope;
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && !m_layoutSVGRoot.hasLayer()) {
+ Optional<ScopedPaintChunkProperties> transformPropertyScope;
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
const auto* objectProperties = m_layoutSVGRoot.objectPaintProperties();
- if (objectProperties && objectProperties->paintOffsetTranslation()) {
+ if (objectProperties && objectProperties->svgLocalTransform()) {
+ auto& paintController = paintInfoBeforeFiltering.context.getPaintController();
+ PaintChunkProperties properties(paintController.currentPaintChunkProperties());
+ properties.transform = objectProperties->svgLocalTransform();
+ transformPropertyScope.emplace(paintController, properties);
+ } else if (objectProperties && objectProperties->paintOffsetTranslation() && !m_layoutSVGRoot.hasLayer()) {
+ // TODO(pdr): Always create an svgLocalTransform and remove this paint offset quirk.
+ // At the HTML->SVG boundary, SVGRoot will have a paint offset transform
+ // paint property but may not have a PaintLayer, so we need to update the
+ // paint properties here since they will not be updated by PaintLayer
+ // (See: PaintPropertyTreeBuilder::createPaintOffsetTranslationIfNeeded).
auto& paintController = paintInfoBeforeFiltering.context.getPaintController();
PaintChunkProperties properties(paintController.currentPaintChunkProperties());
properties.transform = objectProperties->paintOffsetTranslation();
- paintOffsetTranslationPropertyScope.emplace(paintController, properties);
+ transformPropertyScope.emplace(paintController, properties);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698