| 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 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 int fWidth, fHeight; | 267 int fWidth, fHeight; |
| 268 | 268 |
| 269 // Create a new SkPicture from an existing SkPicturePlayback. Ref count of | 269 // Create a new SkPicture from an existing SkPicturePlayback. Ref count of |
| 270 // playback is unchanged. | 270 // playback is unchanged. |
| 271 SkPicture(SkPicturePlayback*, int width, int height); | 271 SkPicture(SkPicturePlayback*, int width, int height); |
| 272 | 272 |
| 273 // For testing. Derived classes may instantiate an alternate | 273 // For testing. Derived classes may instantiate an alternate |
| 274 // SkBBoxHierarchy implementation | 274 // SkBBoxHierarchy implementation |
| 275 virtual SkBBoxHierarchy* createBBoxHierarchy() const; | 275 virtual SkBBoxHierarchy* createBBoxHierarchy() const; |
| 276 private: | 276 private: |
| 277 void createHeader(void* header) const; | 277 void createHeader(SkPictInfo* header) const; |
| 278 | 278 |
| 279 friend class SkFlatPicture; | 279 friend class SkFlatPicture; |
| 280 friend class SkPicturePlayback; | 280 friend class SkPicturePlayback; |
| 281 | 281 |
| 282 typedef SkRefCnt INHERITED; | 282 typedef SkRefCnt INHERITED; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 /** | 285 /** |
| 286 * Subclasses of this can be passed to canvas.drawPicture. During the drawing | 286 * Subclasses of this can be passed to canvas.drawPicture. During the drawing |
| 287 * of the picture, this callback will periodically be invoked. If its | 287 * of the picture, this callback will periodically be invoked. If its |
| 288 * abortDrawing() returns true, then picture playback will be interrupted. | 288 * abortDrawing() returns true, then picture playback will be interrupted. |
| 289 * | 289 * |
| 290 * The resulting drawing is undefined, as there is no guarantee how often the | 290 * 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 | 291 * 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 | 292 * 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. | 293 * to the same level it was before the drawPicture call was made. |
| 294 */ | 294 */ |
| 295 class SK_API SkDrawPictureCallback { | 295 class SK_API SkDrawPictureCallback { |
| 296 public: | 296 public: |
| 297 SkDrawPictureCallback() {} | 297 SkDrawPictureCallback() {} |
| 298 virtual ~SkDrawPictureCallback() {} | 298 virtual ~SkDrawPictureCallback() {} |
| 299 | 299 |
| 300 virtual bool abortDrawing() = 0; | 300 virtual bool abortDrawing() = 0; |
| 301 }; | 301 }; |
| 302 | 302 |
| 303 #endif | 303 #endif |
| OLD | NEW |