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

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

Issue 195223003: Fixing SkPicture serialization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed comments Created 6 years, 9 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
« no previous file with comments | « no previous file | include/core/SkReadBuffer.h » ('j') | src/core/SkPicturePlayback.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkImageDecoder.h" 14 #include "SkImageDecoder.h"
15 #include "SkRefCnt.h" 15 #include "SkRefCnt.h"
16 16
17 class SkBBoxHierarchy; 17 class SkBBoxHierarchy;
18 class SkCanvas; 18 class SkCanvas;
19 class SkDrawPictureCallback; 19 class SkDrawPictureCallback;
20 class SkData; 20 class SkData;
21 class SkPicturePlayback; 21 class SkPicturePlayback;
22 class SkPictureRecord; 22 class SkPictureRecord;
23 class SkStream; 23 class SkStream;
24 class SkWStream; 24 class SkWStream;
25 25
26 struct SkPictInfo; 26 struct SkPictInfo;
27 struct SkPictureHeader;
27 28
28 /** \class SkPicture 29 /** \class SkPicture
29 30
30 The SkPicture class records the drawing commands made to a canvas, to 31 The SkPicture class records the drawing commands made to a canvas, to
31 be played back at a later time. 32 be played back at a later time.
32 */ 33 */
33 class SK_API SkPicture : public SkRefCnt { 34 class SK_API SkPicture : public SkRefCnt {
34 public: 35 public:
35 SK_DECLARE_INST_COUNT(SkPicture) 36 SK_DECLARE_INST_COUNT(SkPicture)
36 37
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 int fWidth, fHeight; 268 int fWidth, fHeight;
268 269
269 // Create a new SkPicture from an existing SkPicturePlayback. Ref count of 270 // Create a new SkPicture from an existing SkPicturePlayback. Ref count of
270 // playback is unchanged. 271 // playback is unchanged.
271 SkPicture(SkPicturePlayback*, int width, int height); 272 SkPicture(SkPicturePlayback*, int width, int height);
272 273
273 // For testing. Derived classes may instantiate an alternate 274 // For testing. Derived classes may instantiate an alternate
274 // SkBBoxHierarchy implementation 275 // SkBBoxHierarchy implementation
275 virtual SkBBoxHierarchy* createBBoxHierarchy() const; 276 virtual SkBBoxHierarchy* createBBoxHierarchy() const;
276 private: 277 private:
277 void createHeader(void* header) const; 278 void createHeader(SkPictureHeader* header) const;
278 279
279 friend class SkFlatPicture; 280 friend class SkFlatPicture;
280 friend class SkPicturePlayback; 281 friend class SkPicturePlayback;
281 282
282 typedef SkRefCnt INHERITED; 283 typedef SkRefCnt INHERITED;
283 }; 284 };
284 285
285 /** 286 /**
286 * Subclasses of this can be passed to canvas.drawPicture. During the drawing 287 * Subclasses of this can be passed to canvas.drawPicture. During the drawing
287 * of the picture, this callback will periodically be invoked. If its 288 * of the picture, this callback will periodically be invoked. If its
288 * abortDrawing() returns true, then picture playback will be interrupted. 289 * abortDrawing() returns true, then picture playback will be interrupted.
289 * 290 *
290 * The resulting drawing is undefined, as there is no guarantee how often the 291 * The resulting drawing is undefined, as there is no guarantee how often the
291 * callback will be invoked. If the abort happens inside some level of nested 292 * callback will be invoked. If the abort happens inside some level of nested
292 * calls to save(), restore will automatically be called to return the state 293 * calls to save(), restore will automatically be called to return the state
293 * to the same level it was before the drawPicture call was made. 294 * to the same level it was before the drawPicture call was made.
294 */ 295 */
295 class SK_API SkDrawPictureCallback { 296 class SK_API SkDrawPictureCallback {
296 public: 297 public:
297 SkDrawPictureCallback() {} 298 SkDrawPictureCallback() {}
298 virtual ~SkDrawPictureCallback() {} 299 virtual ~SkDrawPictureCallback() {}
299 300
300 virtual bool abortDrawing() = 0; 301 virtual bool abortDrawing() = 0;
301 }; 302 };
302 303
303 #endif 304 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkReadBuffer.h » ('j') | src/core/SkPicturePlayback.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698