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

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

Issue 2045253005: Re-implement SVG transform paint property nodes [spv2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 4 years, 6 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 1cbdbbf6a63e995fa5c18f7810f49941055bbe8a..f58f6f74c09c1e5470f4ad678cb90fadeee30afb 100644
--- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
@@ -45,24 +45,16 @@ void SVGRootPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO
PaintInfo paintInfoBeforeFiltering(paintInfo);
- Optional<ScopedPaintChunkProperties> transformPropertyScope;
+ Optional<ScopedPaintChunkProperties> propertyScope;
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
const auto* objectProperties = m_layoutSVGRoot.objectPaintProperties();
- if (objectProperties && objectProperties->svgLocalTransform()) {
+ // If a transform exists, we can rely on a paint layer existing to apply it.
+ DCHECK(!objectProperties || !objectProperties->transform() || m_layoutSVGRoot.hasLayer());
+ if (objectProperties && objectProperties->svgLocalToBorderBoxTransform()) {
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();
- transformPropertyScope.emplace(paintController, properties);
+ properties.transform = objectProperties->svgLocalToBorderBoxTransform();
+ propertyScope.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