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

Unified Diff: ui/compositor/paint_recorder.cc

Issue 2476113002: Change call-sites now that SkCanvas is not ref-counted (Closed)
Patch Set: address comments from #6 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..798eb6eb3f588ab3e4566379503612f4c28e462c 100644
--- a/ui/compositor/paint_recorder.cc
+++ b/ui/compositor/paint_recorder.cc
@@ -18,11 +18,14 @@ 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)))),
+ // The SkCanvas pointer returned by beginRecording is owned by the
+ // recorder_
danakj 2016/11/14 20:59:56 fix wrapping please
reed1 2016/11/14 21:28:51 Done.
+ // so no need to store a RefPtr to it on this class, we just store the
danakj 2016/11/14 20:59:56 Hm this is still referring to RefPtr. How about s
reed1 2016/11/14 21:28:51 New comment uploaded, that also references cache,
+ // gfx::Canvas.
+ // The caller must ensure that the PaintContext's recorder_ outlives this
+ // object.
+ 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