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

Unified Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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 | « Source/core/paint/ViewPainter.cpp ('k') | Source/platform/graphics/GraphicsLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index 04b2c5c012482b7952487802461b58f9ff4bdfad..9726286358bc77021cae9a0b118c3c3f49567fdc 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -245,15 +245,13 @@ void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize
spacedTile.expand(repeatSpacing);
SkPictureBuilder patternPicture(spacedTile, nullptr, context);
- {
+ if (!DrawingRecorder::useCachedDrawingIfPossible(patternPicture.context(), *this, DisplayItem::Type::SVGImage)) {
DrawingRecorder patternPictureRecorder(patternPicture.context(), *this, DisplayItem::Type::SVGImage, spacedTile);
- if (!patternPictureRecorder.canUseCachedDrawing()) {
- // When generating an expanded tile, make sure we don't draw into the spacing area.
- if (tile != spacedTile)
- patternPicture.context().clip(tile);
- SkPaint paint;
- drawForContainer(patternPicture.context().canvas(), paint, containerSize, zoom, tile, srcRect);
- }
+ // When generating an expanded tile, make sure we don't draw into the spacing area.
+ if (tile != spacedTile)
+ patternPicture.context().clip(tile);
+ SkPaint paint;
+ drawForContainer(patternPicture.context().canvas(), paint, containerSize, zoom, tile, srcRect);
}
RefPtr<const SkPicture> tilePicture = patternPicture.endRecording();
« no previous file with comments | « Source/core/paint/ViewPainter.cpp ('k') | Source/platform/graphics/GraphicsLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698