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

Side by Side Diff: include/core/SkPictureRecorder.h

Issue 732653004: option to return drawable from recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: plumb pictlist down to layer hoister 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
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 #ifndef SkPictureRecorder_DEFINED 8 #ifndef SkPictureRecorder_DEFINED
9 #define SkPictureRecorder_DEFINED 9 #define SkPictureRecorder_DEFINED
10 10
11 #include "SkBBHFactory.h" 11 #include "SkBBHFactory.h"
12 #include "SkPicture.h" 12 #include "SkPicture.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 14
15 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK 15 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
16 namespace android { 16 namespace android {
17 class Picture; 17 class Picture;
18 }; 18 };
19 #endif 19 #endif
20 20
21 class SkCanvas; 21 class SkCanvas;
22 class SkCanvasDrawable;
22 class SkPictureRecord; 23 class SkPictureRecord;
23 class SkRecord; 24 class SkRecord;
24 class SkRecorder; 25 class SkRecorder;
25 26
26 class SK_API SkPictureRecorder : SkNoncopyable { 27 class SK_API SkPictureRecorder : SkNoncopyable {
27 public: 28 public:
28 SkPictureRecorder(); 29 SkPictureRecorder();
29 ~SkPictureRecorder(); 30 ~SkPictureRecorder();
30 31
31 #ifdef SK_LEGACY_PICTURE_SIZE_API 32 #ifdef SK_LEGACY_PICTURE_SIZE_API
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 not active. This does not alter the refcnt on the canvas (if present). 65 not active. This does not alter the refcnt on the canvas (if present).
65 */ 66 */
66 SkCanvas* getRecordingCanvas(); 67 SkCanvas* getRecordingCanvas();
67 68
68 /** Signal that the caller is done recording. This invalidates the canvas 69 /** Signal that the caller is done recording. This invalidates the canvas
69 returned by beginRecording/getRecordingCanvas, and returns the 70 returned by beginRecording/getRecordingCanvas, and returns the
70 created SkPicture. Note that the returned picture has its creation 71 created SkPicture. Note that the returned picture has its creation
71 ref which the caller must take ownership of. 72 ref which the caller must take ownership of.
72 */ 73 */
73 SkPicture* endRecording(); 74 SkPicture* endRecording();
74 75
robertphillips 2014/11/24 15:42:02 // Is it too early for a comment ?
reed1 2014/11/24 17:10:48 Done.
76 SkCanvasDrawable* EXPERIMENTAL_endRecordingAsDrawable();
77
75 private: 78 private:
76 void reset(); 79 void reset();
77 80
78 /** Replay the current (partially recorded) operation stream into 81 /** Replay the current (partially recorded) operation stream into
79 canvas. This call doesn't close the current recording. 82 canvas. This call doesn't close the current recording.
80 */ 83 */
81 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK 84 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
82 friend class android::Picture; 85 friend class android::Picture;
83 #endif 86 #endif
84 friend class SkPictureRecorderReplayTester; // for unit testing 87 friend class SkPictureRecorderReplayTester; // for unit testing
85 void partialReplay(SkCanvas* canvas) const; 88 void partialReplay(SkCanvas* canvas) const;
86 89
87 uint32_t fFlags; 90 uint32_t fFlags;
88 SkRect fCullRect; 91 SkRect fCullRect;
89 SkAutoTUnref<SkBBoxHierarchy> fBBH; 92 SkAutoTUnref<SkBBoxHierarchy> fBBH;
90 SkAutoTUnref<SkRecorder> fRecorder; 93 SkAutoTUnref<SkRecorder> fRecorder;
91 SkAutoTDelete<SkRecord> fRecord; 94 SkAutoTUnref<SkRecord> fRecord;
92 95
93 typedef SkNoncopyable INHERITED; 96 typedef SkNoncopyable INHERITED;
94 }; 97 };
95 98
96 #endif 99 #endif
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | samplecode/SampleArc.cpp » ('j') | samplecode/SampleArc.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698