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 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // back. 0 indicates no call is active. | 31 // back. 0 indicates no call is active. |
32 size_t curOpID() const { return fCurOffset; } | 32 size_t curOpID() const { return fCurOffset; } |
33 void resetOpID() { fCurOffset = 0; } | 33 void resetOpID() { fCurOffset = 0; } |
34 | 34 |
35 protected: | 35 protected: |
36 const SkPictureData* fPictureData; | 36 const SkPictureData* fPictureData; |
37 | 37 |
38 // The offset of the current operation when within the draw method | 38 // The offset of the current operation when within the draw method |
39 size_t fCurOffset; | 39 size_t fCurOffset; |
40 | 40 |
41 void handleOp(SkReader32* reader, | 41 void handleOp(SkReadBuffer* reader, |
42 DrawType op, | 42 DrawType op, |
43 uint32_t size, | 43 uint32_t size, |
44 SkCanvas* canvas, | 44 SkCanvas* canvas, |
45 const SkMatrix& initialMatrix); | 45 const SkMatrix& initialMatrix); |
46 | 46 |
47 static DrawType ReadOpAndSize(SkReader32* reader, uint32_t* size); | 47 static DrawType ReadOpAndSize(SkReadBuffer* reader, uint32_t* size); |
48 | 48 |
49 class AutoResetOpID { | 49 class AutoResetOpID { |
50 public: | 50 public: |
51 AutoResetOpID(SkPicturePlayback* playback) : fPlayback(playback) { } | 51 AutoResetOpID(SkPicturePlayback* playback) : fPlayback(playback) { } |
52 ~AutoResetOpID() { | 52 ~AutoResetOpID() { |
53 if (fPlayback) { | 53 if (fPlayback) { |
54 fPlayback->resetOpID(); | 54 fPlayback->resetOpID(); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 private: | 58 private: |
59 SkPicturePlayback* fPlayback; | 59 SkPicturePlayback* fPlayback; |
60 }; | 60 }; |
61 | 61 |
62 private: | 62 private: |
63 typedef SkNoncopyable INHERITED; | 63 typedef SkNoncopyable INHERITED; |
64 }; | 64 }; |
65 | 65 |
66 #endif | 66 #endif |
OLD | NEW |