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

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

Issue 732653004: option to return drawable from recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/core/SkCanvasDrawable.h ('k') | src/core/SkPicture.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 "SkCanvasDrawable.h" 9 #include "SkCanvasDrawable.h"
10 #include "SkThread.h" 10 #include "SkThread.h"
(...skipping 23 matching lines...) Expand all
34 34
35 void SkCanvasDrawable::draw(SkCanvas* canvas) { 35 void SkCanvasDrawable::draw(SkCanvas* canvas) {
36 SkAutoCanvasRestore acr(canvas, true); 36 SkAutoCanvasRestore acr(canvas, true);
37 this->onDraw(canvas); 37 this->onDraw(canvas);
38 38
39 if (false) { 39 if (false) {
40 draw_bbox(canvas, this->getBounds()); 40 draw_bbox(canvas, this->getBounds());
41 } 41 }
42 } 42 }
43 43
44 SkPicture* SkCanvasDrawable::newPictureSnapshot(SkBBHFactory* bbhFactory, uint32 _t recordFlags) { 44 SkPicture* SkCanvasDrawable::newPictureSnapshot() {
45 return this->onNewPictureSnapshot(bbhFactory, recordFlags); 45 return this->onNewPictureSnapshot();
46 } 46 }
47 47
48 uint32_t SkCanvasDrawable::getGenerationID() { 48 uint32_t SkCanvasDrawable::getGenerationID() {
49 if (0 == fGenerationID) { 49 if (0 == fGenerationID) {
50 fGenerationID = next_generation_id(); 50 fGenerationID = next_generation_id();
51 } 51 }
52 return fGenerationID; 52 return fGenerationID;
53 } 53 }
54 54
55 SkRect SkCanvasDrawable::getBounds() { 55 SkRect SkCanvasDrawable::getBounds() {
56 return this->onGetBounds(); 56 return this->onGetBounds();
57 } 57 }
58 58
59 void SkCanvasDrawable::notifyDrawingChanged() { 59 void SkCanvasDrawable::notifyDrawingChanged() {
60 fGenerationID = 0; 60 fGenerationID = 0;
61 } 61 }
62 62
63 //////////////////////////////////////////////////////////////////////////////// ///////// 63 //////////////////////////////////////////////////////////////////////////////// /////////
64 64
65 #include "SkPictureRecorder.h" 65 #include "SkPictureRecorder.h"
66 66
67 SkPicture* SkCanvasDrawable::onNewPictureSnapshot(SkBBHFactory* bbhFactory, uint 32_t recordFlags) { 67 SkPicture* SkCanvasDrawable::onNewPictureSnapshot() {
68 SkPictureRecorder recorder; 68 SkPictureRecorder recorder;
69 69
70 const SkRect bounds = this->getBounds(); 70 const SkRect bounds = this->getBounds();
71 SkCanvas* canvas = recorder.beginRecording(bounds, bbhFactory, recordFlags); 71 SkCanvas* canvas = recorder.beginRecording(bounds, NULL, 0);
72 this->draw(canvas); 72 this->draw(canvas);
73 if (false) { 73 if (false) {
74 draw_bbox(canvas, bounds); 74 draw_bbox(canvas, bounds);
75 } 75 }
76 return recorder.endRecording(); 76 return recorder.endRecording();
77 } 77 }
OLDNEW
« no previous file with comments | « src/core/SkCanvasDrawable.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698