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

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

Issue 1655553002: Update svg's root paint offset property during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only update SVG paint offset property Created 4 years, 11 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/LayoutTests/virtual/spv2/svg/README.txt ('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 037977a413e374c561793d0b5cbbd99772246c78..78fcd50987fe805d04bdefa8f0d2765c1dd1b690 100644
--- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp
@@ -8,12 +8,14 @@
#include "core/layout/svg/SVGResources.h"
#include "core/layout/svg/SVGResourcesCache.h"
#include "core/paint/BoxPainter.h"
+#include "core/paint/ObjectPaintProperties.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/PaintTiming.h"
#include "core/paint/SVGPaintContext.h"
#include "core/paint/TransformRecorder.h"
#include "core/svg/SVGSVGElement.h"
#include "platform/graphics/paint/ClipRecorder.h"
+#include "platform/graphics/paint/ScopedPaintChunkProperties.h"
#include "wtf/Optional.h"
namespace blink {
@@ -44,6 +46,21 @@ 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()) {
+ const auto* objectProperties = m_layoutSVGRoot.objectPaintProperties();
+ if (objectProperties && objectProperties->paintOffsetTranslation()) {
+ auto& paintController = paintInfoBeforeFiltering.context.paintController();
+ PaintChunkProperties properties(paintController.currentPaintChunkProperties());
+ properties.transform = objectProperties->paintOffsetTranslation();
+ paintOffsetTranslationPropertyScope.emplace(paintController, properties);
+ }
+ }
+
// Apply initial viewport clip.
Optional<ClipRecorder> clipRecorder;
if (m_layoutSVGRoot.shouldApplyViewportClip()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/virtual/spv2/svg/README.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698