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

Side by Side Diff: src/c/sk_surface.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 | « samplecode/SampleTiling.cpp ('k') | src/core/SkDrawable.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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 void sk_picture_recorder_delete(sk_picture_recorder_t* crec) { 475 void sk_picture_recorder_delete(sk_picture_recorder_t* crec) {
476 delete AsPictureRecorder(crec); 476 delete AsPictureRecorder(crec);
477 } 477 }
478 478
479 sk_canvas_t* sk_picture_recorder_begin_recording(sk_picture_recorder_t* crec, 479 sk_canvas_t* sk_picture_recorder_begin_recording(sk_picture_recorder_t* crec,
480 const sk_rect_t* cbounds) { 480 const sk_rect_t* cbounds) {
481 return ToCanvas(AsPictureRecorder(crec)->beginRecording(AsRect(*cbounds))); 481 return ToCanvas(AsPictureRecorder(crec)->beginRecording(AsRect(*cbounds)));
482 } 482 }
483 483
484 sk_picture_t* sk_picture_recorder_end_recording(sk_picture_recorder_t* crec) { 484 sk_picture_t* sk_picture_recorder_end_recording(sk_picture_recorder_t* crec) {
485 return ToPicture(AsPictureRecorder(crec)->endRecording()); 485 return ToPicture(AsPictureRecorder(crec)->finishRecordingAsPicture().release ());
486 } 486 }
487 487
488 void sk_picture_ref(sk_picture_t* cpic) { 488 void sk_picture_ref(sk_picture_t* cpic) {
489 SkSafeRef(AsPicture(cpic)); 489 SkSafeRef(AsPicture(cpic));
490 } 490 }
491 491
492 void sk_picture_unref(sk_picture_t* cpic) { 492 void sk_picture_unref(sk_picture_t* cpic) {
493 SkSafeUnref(AsPicture(cpic)); 493 SkSafeUnref(AsPicture(cpic));
494 } 494 }
495 495
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 698
699 size_t sk_data_get_size(const sk_data_t* cdata) { 699 size_t sk_data_get_size(const sk_data_t* cdata) {
700 return AsData(cdata)->size(); 700 return AsData(cdata)->size();
701 } 701 }
702 702
703 const void* sk_data_get_data(const sk_data_t* cdata) { 703 const void* sk_data_get_data(const sk_data_t* cdata) {
704 return AsData(cdata)->data(); 704 return AsData(cdata)->data();
705 } 705 }
706 706
707 //////////////////////////////////////////////////////////////////////////////// /////////// 707 //////////////////////////////////////////////////////////////////////////////// ///////////
OLDNEW
« no previous file with comments | « samplecode/SampleTiling.cpp ('k') | src/core/SkDrawable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698