| 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 SkPaint; | 15 class SkPaint; |
| 16 class SkPictureData; | 16 class SkPictureData; |
| 17 | 17 |
| 18 // 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. |
| 19 class SkPicturePlayback : SkNoncopyable { | 19 class SkPicturePlayback final : SkNoncopyable { |
| 20 public: | 20 public: |
| 21 SkPicturePlayback(const SkPictureData* data) | 21 SkPicturePlayback(const SkPictureData* data) |
| 22 : fPictureData(data) | 22 : fPictureData(data) |
| 23 , fCurOffset(0) { | 23 , fCurOffset(0) { |
| 24 } | 24 } |
| 25 virtual ~SkPicturePlayback() { } | |
| 26 | 25 |
| 27 virtual void draw(SkCanvas* canvas, SkPicture::AbortCallback*); | 26 void draw(SkCanvas* canvas, SkPicture::AbortCallback*, const SkReadBuffer* b
uffer); |
| 28 | 27 |
| 29 // TODO: remove the curOp calls after cleaning up GrGatherDevice | 28 // TODO: remove the curOp calls after cleaning up GrGatherDevice |
| 30 // Return the ID of the operation currently being executed when playing | 29 // Return the ID of the operation currently being executed when playing |
| 31 // back. 0 indicates no call is active. | 30 // back. 0 indicates no call is active. |
| 32 size_t curOpID() const { return fCurOffset; } | 31 size_t curOpID() const { return fCurOffset; } |
| 33 void resetOpID() { fCurOffset = 0; } | 32 void resetOpID() { fCurOffset = 0; } |
| 34 | 33 |
| 35 protected: | 34 protected: |
| 36 const SkPictureData* fPictureData; | 35 const SkPictureData* fPictureData; |
| 37 | 36 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 | 56 |
| 58 private: | 57 private: |
| 59 SkPicturePlayback* fPlayback; | 58 SkPicturePlayback* fPlayback; |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 private: | 61 private: |
| 63 typedef SkNoncopyable INHERITED; | 62 typedef SkNoncopyable INHERITED; |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 #endif | 65 #endif |
| OLD | NEW |