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

Unified Diff: ui/compositor/paint_recorder.cc

Issue 2519083002: Revert "Revert "Change call-sites now that SkCanvas is not ref-counted"" (Closed)
Patch Set: rebase 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp ('k') | ui/gfx/blit_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/paint_recorder.cc
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc
index 2c01e5c43d9c9f41835f99f91c3e8ea54b876a58..b48717dc307aa371a6b5887429f63700ce4d47e7 100644
--- a/ui/compositor/paint_recorder.cc
+++ b/ui/compositor/paint_recorder.cc
@@ -14,15 +14,15 @@
namespace ui {
+// This class records a reference to the context, the canvas returned
+// by its recorder_, and the cache. Thus all 3 of these must remain
+// valid for the lifetime of this object.
PaintRecorder::PaintRecorder(const PaintContext& context,
const gfx::Size& recording_size,
PaintCache* cache)
: context_(context),
- // The SkCanvas reference returned by beginRecording is shared with
- // the recorder_ so no need to store a RefPtr to it on this class, we just
- // store the gfx::Canvas.
- canvas_(sk_ref_sp(context.recorder_->beginRecording(
- gfx::RectToSkRect(gfx::Rect(recording_size)))),
+ canvas_(context.recorder_->beginRecording(
+ gfx::RectToSkRect(gfx::Rect(recording_size))),
context.device_scale_factor_),
cache_(cache),
bounds_in_layer_(context.ToLayerSpaceBounds(recording_size)) {
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp ('k') | ui/gfx/blit_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698