OLD | NEW |
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 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 * must call unref() when they are done using it. | 68 * must call unref() when they are done using it. |
69 * | 69 * |
70 * The returned picture is immutable. If during recording drawables were ad
ded to the canvas, | 70 * The returned picture is immutable. If during recording drawables were ad
ded to the canvas, |
71 * these will have been "drawn" into a recording canvas, so that this resul
ting picture will | 71 * these will have been "drawn" into a recording canvas, so that this resul
ting picture will |
72 * reflect their current state, but will not contain a live reference to th
e drawables | 72 * reflect their current state, but will not contain a live reference to th
e drawables |
73 * themselves. | 73 * themselves. |
74 */ | 74 */ |
75 SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture(); | 75 SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture(); |
76 | 76 |
77 /** | 77 /** |
| 78 * Signal that the caller is done recording, and update the cull rect to us
e for bounding |
| 79 * box hierarchy (BBH) generation. The behavior is the same as calling |
| 80 * endRecordingAsPicture(), except that this method updates the cull rect i
nitially passed |
| 81 * into beginRecording. |
| 82 * @param cullRect the new culling rectangle to use as the overall bound fo
r BBH generation |
| 83 * and subsequent culling operations. |
| 84 * @return the picture containing the recorded content. |
| 85 */ |
| 86 SkPicture* SK_WARN_UNUSED_RESULT endRecordingAsPicture(const SkRect& cullRec
t); |
| 87 |
| 88 /** |
78 * Signal that the caller is done recording. This invalidates the canvas re
turned by | 89 * Signal that the caller is done recording. This invalidates the canvas re
turned by |
79 * beginRecording/getRecordingCanvas. Ownership of the object is passed to
the caller, who | 90 * beginRecording/getRecordingCanvas. Ownership of the object is passed to
the caller, who |
80 * must call unref() when they are done using it. | 91 * must call unref() when they are done using it. |
81 * | 92 * |
82 * Unlike endRecordingAsPicture(), which returns an immutable picture, the
returned drawable | 93 * Unlike endRecordingAsPicture(), which returns an immutable picture, the
returned drawable |
83 * may contain live references to other drawables (if they were added to th
e recording canvas) | 94 * may contain live references to other drawables (if they were added to th
e recording canvas) |
84 * and therefore this drawable will reflect the current state of those nest
ed drawables anytime | 95 * and therefore this drawable will reflect the current state of those nest
ed drawables anytime |
85 * it is drawn or a new picture is snapped from it (by calling drawable->ne
wPictureSnapshot()). | 96 * it is drawn or a new picture is snapped from it (by calling drawable->ne
wPictureSnapshot()). |
86 */ | 97 */ |
87 SkDrawable* SK_WARN_UNUSED_RESULT endRecordingAsDrawable(); | 98 SkDrawable* SK_WARN_UNUSED_RESULT endRecordingAsDrawable(); |
(...skipping 18 matching lines...) Expand all Loading... |
106 SkRect fCullRect; | 117 SkRect fCullRect; |
107 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 118 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
108 SkAutoTUnref<SkRecorder> fRecorder; | 119 SkAutoTUnref<SkRecorder> fRecorder; |
109 SkAutoTUnref<SkRecord> fRecord; | 120 SkAutoTUnref<SkRecord> fRecord; |
110 SkMiniRecorder fMiniRecorder; | 121 SkMiniRecorder fMiniRecorder; |
111 | 122 |
112 typedef SkNoncopyable INHERITED; | 123 typedef SkNoncopyable INHERITED; |
113 }; | 124 }; |
114 | 125 |
115 #endif | 126 #endif |
OLD | NEW |