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

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

Issue 14598023: add SkDrawPictureCallback optional parameter to drawPicture(), which can abort the picture drawing. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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 "SkRefCnt.h" 14 #include "SkRefCnt.h"
15 15
16 class SkBBoxHierarchy; 16 class SkBBoxHierarchy;
17 class SkCanvas; 17 class SkCanvas;
18 class SkDrawPictureCallback;
18 class SkPicturePlayback; 19 class SkPicturePlayback;
19 class SkPictureRecord; 20 class SkPictureRecord;
20 class SkStream; 21 class SkStream;
21 class SkWStream; 22 class SkWStream;
22 23
23 /** \class SkPicture 24 /** \class SkPicture
24 25
25 The SkPicture class records the drawing commands made to a canvas, to 26 The SkPicture class records the drawing commands made to a canvas, to
26 be played back at a later time. 27 be played back at a later time.
27 */ 28 */
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
151 /** Replays the drawing commands on the specified canvas. This internally 152 /** Replays the drawing commands on the specified canvas. This internally
152 calls endRecording() if that has not already been called. 153 calls endRecording() if that has not already been called.
153 @param surface the canvas receiving the drawing commands. 154 @param canvas the canvas receiving the drawing commands.
robertphillips 2013/05/16 15:04:23 // @param callback optional callback to abort draw
154 */ 155 */
155 void draw(SkCanvas* surface); 156 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL);
156 157
157 /** Return the width of the picture's recording canvas. This 158 /** Return the width of the picture's recording canvas. This
158 value reflects what was passed to setSize(), and does not necessarily 159 value reflects what was passed to setSize(), and does not necessarily
159 reflect the bounds of what has been recorded into the picture. 160 reflect the bounds of what has been recorded into the picture.
160 @return the width of the picture's recording canvas 161 @return the width of the picture's recording canvas
161 */ 162 */
162 int width() const { return fWidth; } 163 int width() const { return fWidth; }
163 164
164 /** Return the height of the picture's recording canvas. This 165 /** Return the height of the picture's recording canvas. This
165 value reflects what was passed to setSize(), and does not necessarily 166 value reflects what was passed to setSize(), and does not necessarily
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 */ 242 */
242 SkCanvas* getRecordingCanvas() const { return fCanvas; } 243 SkCanvas* getRecordingCanvas() const { return fCanvas; }
243 244
244 private: 245 private:
245 SkPicture* fPicture; 246 SkPicture* fPicture;
246 SkCanvas* fCanvas; 247 SkCanvas* fCanvas;
247 }; 248 };
248 249
249 250
250 #endif 251 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | src/core/SkPicturePlayback.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698