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

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: Fix some !'s and &&'s. De Morgan would be proud. Created 5 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
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index 10d9c830a48b223a12c624189e24966d0c0242db..94b210010e192f5f730436ccd82ce459320d9e20 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();

Powered by Google App Engine
This is Rietveld 408576698