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