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

Side by Side Diff: src/core/SkDrawable.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/c/sk_surface.cpp ('k') | src/core/SkMiniRecorder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDrawable.h" 10 #include "SkDrawable.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 SkPicture* SkDrawable::onNewPictureSnapshot() { 75 SkPicture* SkDrawable::onNewPictureSnapshot() {
76 SkPictureRecorder recorder; 76 SkPictureRecorder recorder;
77 77
78 const SkRect bounds = this->getBounds(); 78 const SkRect bounds = this->getBounds();
79 SkCanvas* canvas = recorder.beginRecording(bounds, nullptr, 0); 79 SkCanvas* canvas = recorder.beginRecording(bounds, nullptr, 0);
80 this->draw(canvas); 80 this->draw(canvas);
81 if (false) { 81 if (false) {
82 draw_bbox(canvas, bounds); 82 draw_bbox(canvas, bounds);
83 } 83 }
84 return recorder.endRecording(); 84 return recorder.finishRecordingAsPicture().release();
85 } 85 }
OLDNEW
« no previous file with comments | « src/c/sk_surface.cpp ('k') | src/core/SkMiniRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698