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* info) const; |
| 278 static bool IsValidPictInfo(const SkPictInfo& info); |
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 |
OLD | NEW |