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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h

Issue 2500533003: Cache display items from SVGImage contents. (Closed)
Patch Set: none Created 4 years, 1 month 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/platform/graphics/paint/SkPictureBuilder.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h b/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
index 73fbd89883bc8f158a8124af920fdab7d3544bf9..a6b3d4c1c152cd9e57165ee07b9fc9972152f7fb 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
@@ -31,9 +31,14 @@ class PLATFORM_EXPORT SkPictureBuilder final : public DisplayItemClient {
// builder's internal canvas. If |containingContext| is specified, the device
// scale factor, printing, and disabled state are propagated to the builder's
// internal context.
+ // If a PaintController is passed, it is used as the PaintController for
+ // painting the picture (and hence we can use its cache). Otherwise, a new
+ // PaintController is used for the duration of the picture building, which
+ // therefore has no caching.
SkPictureBuilder(const FloatRect& bounds,
SkMetaData* = nullptr,
- GraphicsContext* containingContext = nullptr);
+ GraphicsContext* containingContext = nullptr,
+ PaintController* = nullptr);
~SkPictureBuilder();
GraphicsContext& context() { return *m_context; }
@@ -47,7 +52,8 @@ class PLATFORM_EXPORT SkPictureBuilder final : public DisplayItemClient {
LayoutRect visualRect() const final { return LayoutRect(); }
private:
- std::unique_ptr<PaintController> m_paintController;
+ PaintController* m_paintController;
+ std::unique_ptr<PaintController> m_paintControllerPtr;
std::unique_ptr<GraphicsContext> m_context;
FloatRect m_bounds;
};

Powered by Google App Engine
This is Rietveld 408576698