| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkPicturePlayback_DEFINED | 8 #ifndef SkPicturePlayback_DEFINED |
| 9 #define SkPicturePlayback_DEFINED | 9 #define SkPicturePlayback_DEFINED |
| 10 | 10 |
| 11 #include "SkPictureFlat.h" // for DrawType | 11 #include "SkPictureFlat.h" // for DrawType |
| 12 | 12 |
| 13 class SkBitmap; | 13 class SkBitmap; |
| 14 class SkCanvas; | 14 class SkCanvas; |
| 15 class SkDrawPictureCallback; | |
| 16 class SkPaint; | 15 class SkPaint; |
| 17 class SkPictureData; | 16 class SkPictureData; |
| 18 | 17 |
| 19 // The basic picture playback class replays the provided picture into a canvas. | 18 // The basic picture playback class replays the provided picture into a canvas. |
| 20 class SkPicturePlayback : SkNoncopyable { | 19 class SkPicturePlayback : SkNoncopyable { |
| 21 public: | 20 public: |
| 22 SkPicturePlayback(const SkPictureData* data) | 21 SkPicturePlayback(const SkPictureData* data) |
| 23 : fPictureData(data) | 22 : fPictureData(data) |
| 24 , fCurOffset(0) { | 23 , fCurOffset(0) { |
| 25 } | 24 } |
| 26 virtual ~SkPicturePlayback() { } | 25 virtual ~SkPicturePlayback() { } |
| 27 | 26 |
| 28 virtual void draw(SkCanvas* canvas, SkDrawPictureCallback*); | 27 virtual void draw(SkCanvas* canvas, SkPicture::AbortCallback*); |
| 29 | 28 |
| 30 // TODO: remove the curOp calls after cleaning up GrGatherDevice | 29 // TODO: remove the curOp calls after cleaning up GrGatherDevice |
| 31 // Return the ID of the operation currently being executed when playing | 30 // Return the ID of the operation currently being executed when playing |
| 32 // back. 0 indicates no call is active. | 31 // back. 0 indicates no call is active. |
| 33 size_t curOpID() const { return fCurOffset; } | 32 size_t curOpID() const { return fCurOffset; } |
| 34 void resetOpID() { fCurOffset = 0; } | 33 void resetOpID() { fCurOffset = 0; } |
| 35 | 34 |
| 36 protected: | 35 protected: |
| 37 const SkPictureData* fPictureData; | 36 const SkPictureData* fPictureData; |
| 38 | 37 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 58 | 57 |
| 59 private: | 58 private: |
| 60 SkPicturePlayback* fPlayback; | 59 SkPicturePlayback* fPlayback; |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 typedef SkNoncopyable INHERITED; | 63 typedef SkNoncopyable INHERITED; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 #endif | 66 #endif |
| OLD | NEW |