OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPicture_DEFINED | 10 #ifndef SkPicture_DEFINED |
11 #define SkPicture_DEFINED | 11 #define SkPicture_DEFINED |
12 | 12 |
13 #include "SkBitmap.h" | 13 #include "SkBitmap.h" |
14 #include "SkImageDecoder.h" | 14 #include "SkImageDecoder.h" |
15 #include "SkRefCnt.h" | 15 #include "SkRefCnt.h" |
| 16 #include "SkTDArray.h" |
16 | 17 |
17 class SkBBoxHierarchy; | 18 class SkBBoxHierarchy; |
18 class SkCanvas; | 19 class SkCanvas; |
19 class SkDrawPictureCallback; | 20 class SkDrawPictureCallback; |
20 class SkData; | 21 class SkData; |
21 class SkPicturePlayback; | 22 class SkPicturePlayback; |
22 class SkPictureRecord; | 23 class SkPictureRecord; |
23 class SkStream; | 24 class SkStream; |
24 class SkWStream; | 25 class SkWStream; |
25 | 26 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 not active. This does not alter the refcnt on the canvas (if present). | 142 not active. This does not alter the refcnt on the canvas (if present). |
142 */ | 143 */ |
143 SkCanvas* getRecordingCanvas() const; | 144 SkCanvas* getRecordingCanvas() const; |
144 /** Signal that the caller is done recording. This invalidates the canvas | 145 /** Signal that the caller is done recording. This invalidates the canvas |
145 returned by beginRecording/getRecordingCanvas, and prepares the picture | 146 returned by beginRecording/getRecordingCanvas, and prepares the picture |
146 for drawing. Note: this happens implicitly the first time the picture | 147 for drawing. Note: this happens implicitly the first time the picture |
147 is drawn. | 148 is drawn. |
148 */ | 149 */ |
149 void endRecording(); | 150 void endRecording(); |
150 | 151 |
| 152 /** PRIVATE / EXPERIMENTAL -- do not call |
| 153 Return the operations required to render the content inside |
| 154 queryRect. A NULL return value means all the operations are needed. |
| 155 A non-NULL but zero sized array means there is nothing to draw. |
| 156 */ |
| 157 const SkTDArray<void*>* EXPERIMENTAL_getActiveOps(const SkIRect& queryRect); |
| 158 |
151 /** Replays the drawing commands on the specified canvas. This internally | 159 /** Replays the drawing commands on the specified canvas. This internally |
152 calls endRecording() if that has not already been called. | 160 calls endRecording() if that has not already been called. |
153 @param canvas the canvas receiving the drawing commands. | 161 @param canvas the canvas receiving the drawing commands. |
154 */ | 162 */ |
155 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL); | 163 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL); |
156 | 164 |
157 /** Return the width of the picture's recording canvas. This | 165 /** Return the width of the picture's recording canvas. This |
158 value reflects what was passed to setSize(), and does not necessarily | 166 value reflects what was passed to setSize(), and does not necessarily |
159 reflect the bounds of what has been recorded into the picture. | 167 reflect the bounds of what has been recorded into the picture. |
160 @return the width of the picture's recording canvas | 168 @return the width of the picture's recording canvas |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 */ | 303 */ |
296 class SK_API SkDrawPictureCallback { | 304 class SK_API SkDrawPictureCallback { |
297 public: | 305 public: |
298 SkDrawPictureCallback() {} | 306 SkDrawPictureCallback() {} |
299 virtual ~SkDrawPictureCallback() {} | 307 virtual ~SkDrawPictureCallback() {} |
300 | 308 |
301 virtual bool abortDrawing() = 0; | 309 virtual bool abortDrawing() = 0; |
302 }; | 310 }; |
303 | 311 |
304 #endif | 312 #endif |
OLD | NEW |