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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp

Issue 2751433002: [SPv2] Flatten property trees in PaintRecordBuilder into a single display list. (Closed)
Patch Set: none Created 3 years, 9 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
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
index bcaa3528527fa331a5b2e46a886a2b30d83d3f17..0536d72de3d077fca9472bd69322fe028716bd93 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
@@ -203,8 +203,6 @@ sk_sp<PaintRecord> LayoutSVGResourcePattern::asPaintRecord(
contentTransform = tileTransform;
FloatRect bounds(FloatPoint(), tileBounds.size());
- PaintRecordBuilder builder(bounds);
-
const LayoutSVGResourceContainer* patternLayoutObject =
resolveContentElement();
DCHECK(patternLayoutObject);
@@ -212,15 +210,17 @@ sk_sp<PaintRecord> LayoutSVGResourcePattern::asPaintRecord(
SubtreeContentTransformScope contentTransformScope(contentTransform);
- {
- TransformRecorder transformRecorder(builder.context(), *patternLayoutObject,
- tileTransform);
- for (LayoutObject* child = patternLayoutObject->firstChild(); child;
- child = child->nextSibling())
- SVGPaintContext::paintResourceSubtree(builder.context(), child);
- }
-
- return builder.endRecording();
+ PaintRecordBuilder builder(bounds);
+ for (LayoutObject* child = patternLayoutObject->firstChild(); child;
+ child = child->nextSibling())
+ SVGPaintContext::paintResourceSubtree(builder.context(), child);
+ PaintRecorder paintRecorder;
+ PaintCanvas* canvas = paintRecorder.beginRecording(bounds);
+ canvas->save();
+ canvas->concat(affineTransformToSkMatrix(tileTransform));
+ canvas->drawPicture(builder.endRecording());
+ canvas->restore();
+ return paintRecorder.finishRecordingAsPicture();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698