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

Unified Diff: third_party/WebKit/Source/core/paint/SVGShapePainter.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/paint/SVGShapePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGShapePainter.cpp b/third_party/WebKit/Source/core/paint/SVGShapePainter.cpp
index 07b4f12432771dde3d4515ec9b03048d873fd23c..4873c0d16e1991d2408ce2dbc953e83eca7878b1 100644
--- a/third_party/WebKit/Source/core/paint/SVGShapePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGShapePainter.cpp
@@ -219,16 +219,7 @@ void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo,
for (const MarkerPosition& markerPosition : *markerPositions) {
if (const LayoutSVGResourceMarker* marker = SVGMarkerData::markerForType(
markerPosition.type, markerStart, markerMid, markerEnd)) {
- PaintRecordBuilder builder(boundingBox, nullptr, &paintInfo.context);
- PaintInfo markerPaintInfo(builder.context(), paintInfo);
-
- // It's expensive to track the transformed paint cull rect for each
- // marker so just disable culling. The shape paint call will already
- // be culled if it is outside the paint info cull rect.
- markerPaintInfo.m_cullRect.m_rect = LayoutRect::infiniteIntRect();
-
- paintMarker(markerPaintInfo, *marker, markerPosition, strokeWidth);
- paintInfo.context.canvas()->PlaybackPaintRecord(builder.endRecording());
+ paintMarker(paintInfo, *marker, markerPosition, strokeWidth);
}
}
}
@@ -240,15 +231,28 @@ void SVGShapePainter::paintMarker(const PaintInfo& paintInfo,
if (!marker.shouldPaint())
return;
- TransformRecorder transformRecorder(
- paintInfo.context, marker,
- marker.markerTransformation(position.origin, position.angle,
- strokeWidth));
- Optional<FloatClipRecorder> clipRecorder;
+ AffineTransform transform =
+ marker.markerTransformation(position.origin, position.angle, strokeWidth);
+
+ PaintCanvas* canvas = paintInfo.context.canvas();
+
+ canvas->save();
+ canvas->concat(affineTransformToSkMatrix(transform));
if (SVGLayoutSupport::isOverflowHidden(&marker))
- clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase,
- marker.viewport());
- SVGContainerPainter(marker).paint(paintInfo);
+ canvas->clipRect(marker.viewport());
+
+ // It's expensive to track the transformed paint cull rect for each
+ // marker so just disable culling. The shape paint call will already
+ // be culled if it is outside the paint info cull rect.
+ IntRect bounds(LayoutRect::infiniteIntRect());
+ PaintRecordBuilder builder(FloatRect(bounds), nullptr, &paintInfo.context);
+ PaintInfo markerPaintInfo(builder.context(), paintInfo);
+ markerPaintInfo.m_cullRect.m_rect = bounds;
+
+ SVGContainerPainter(marker).paint(markerPaintInfo);
+ canvas->PlaybackPaintRecord(builder.endRecording());
+
+ canvas->restore();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGShapePainter.h ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698