| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 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 #ifndef SkPicturePlayback_DEFINED | 8 #ifndef SkPicturePlayback_DEFINED |
| 9 #define SkPicturePlayback_DEFINED | 9 #define SkPicturePlayback_DEFINED |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class SkStream; | 30 class SkStream; |
| 31 class SkWStream; | 31 class SkWStream; |
| 32 class SkBBoxHierarchy; | 32 class SkBBoxHierarchy; |
| 33 class SkPictureStateTree; | 33 class SkPictureStateTree; |
| 34 | 34 |
| 35 struct SkPictInfo { | 35 struct SkPictInfo { |
| 36 enum Flags { | 36 enum Flags { |
| 37 kCrossProcess_Flag = 1 << 0, | 37 kCrossProcess_Flag = 1 << 0, |
| 38 kScalarIsFloat_Flag = 1 << 1, | 38 kScalarIsFloat_Flag = 1 << 1, |
| 39 kPtrIs64Bit_Flag = 1 << 2, | 39 kPtrIs64Bit_Flag = 1 << 2, |
| 40 kHasRecordedBounds_Flag = 1 << 3, |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 uint32_t fVersion; | 43 uint32_t fVersion; |
| 43 uint32_t fWidth; | 44 uint32_t fWidth; |
| 44 uint32_t fHeight; | 45 uint32_t fHeight; |
| 45 uint32_t fFlags; | 46 uint32_t fFlags; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 /** | 49 /** |
| 49 * Container for data that is needed to deep copy a SkPicture. The container | 50 * Container for data that is needed to deep copy a SkPicture. The container |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 SkPicturePlayback(SkStream*, const SkPictInfo&, SkPicture::InstallPixelRefPr
oc); | 66 SkPicturePlayback(SkStream*, const SkPictInfo&, SkPicture::InstallPixelRefPr
oc); |
| 66 | 67 |
| 67 virtual ~SkPicturePlayback(); | 68 virtual ~SkPicturePlayback(); |
| 68 | 69 |
| 69 void draw(SkCanvas& canvas); | 70 void draw(SkCanvas& canvas); |
| 70 | 71 |
| 71 void serialize(SkWStream*, SkPicture::EncodeBitmap) const; | 72 void serialize(SkWStream*, SkPicture::EncodeBitmap) const; |
| 72 | 73 |
| 73 void dumpSize() const; | 74 void dumpSize() const; |
| 74 | 75 |
| 76 bool hasRecordedBounds() const { return fHasRecordedBounds; } |
| 77 |
| 75 #ifdef SK_BUILD_FOR_ANDROID | 78 #ifdef SK_BUILD_FOR_ANDROID |
| 76 // Can be called in the middle of playback (the draw() call). WIll abort the | 79 // Can be called in the middle of playback (the draw() call). WIll abort the |
| 77 // drawing and return from draw() after the "current" op code is done | 80 // drawing and return from draw() after the "current" op code is done |
| 78 void abort() { fAbortCurrentPlayback = true; } | 81 void abort() { fAbortCurrentPlayback = true; } |
| 79 #endif | 82 #endif |
| 80 | 83 |
| 81 protected: | 84 protected: |
| 82 #ifdef SK_DEVELOPER | 85 #ifdef SK_DEVELOPER |
| 83 virtual size_t preDraw(size_t offset, int type); | 86 virtual size_t preDraw(size_t offset, int type); |
| 84 virtual void postDraw(size_t offset); | 87 virtual void postDraw(size_t offset); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 SkData* fOpData; // opcodes and parameters | 215 SkData* fOpData; // opcodes and parameters |
| 213 | 216 |
| 214 SkPicture** fPictureRefs; | 217 SkPicture** fPictureRefs; |
| 215 int fPictureCount; | 218 int fPictureCount; |
| 216 | 219 |
| 217 SkBBoxHierarchy* fBoundingHierarchy; | 220 SkBBoxHierarchy* fBoundingHierarchy; |
| 218 SkPictureStateTree* fStateTree; | 221 SkPictureStateTree* fStateTree; |
| 219 | 222 |
| 220 SkTypefacePlayback fTFPlayback; | 223 SkTypefacePlayback fTFPlayback; |
| 221 SkFactoryPlayback* fFactoryPlayback; | 224 SkFactoryPlayback* fFactoryPlayback; |
| 225 |
| 226 bool fHasRecordedBounds; |
| 222 #ifdef SK_BUILD_FOR_ANDROID | 227 #ifdef SK_BUILD_FOR_ANDROID |
| 223 SkMutex fDrawMutex; | 228 SkMutex fDrawMutex; |
| 224 bool fAbortCurrentPlayback; | 229 bool fAbortCurrentPlayback; |
| 225 #endif | 230 #endif |
| 226 }; | 231 }; |
| 227 | 232 |
| 228 #endif | 233 #endif |
| OLD | NEW |