OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef SkPictureFlat_DEFINED | 7 #ifndef SkPictureFlat_DEFINED |
8 #define SkPictureFlat_DEFINED | 8 #define SkPictureFlat_DEFINED |
9 | 9 |
10 | 10 #include "SkCanvas.h" |
11 #include "SkChecksum.h" | 11 #include "SkChecksum.h" |
12 #include "SkChunkAlloc.h" | 12 #include "SkChunkAlloc.h" |
13 #include "SkReadBuffer.h" | 13 #include "SkReadBuffer.h" |
14 #include "SkWriteBuffer.h" | 14 #include "SkWriteBuffer.h" |
15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
16 #include "SkPicture.h" | 16 #include "SkPicture.h" |
17 #include "SkPtrRecorder.h" | 17 #include "SkPtrRecorder.h" |
18 #include "SkTDynamicHash.h" | 18 #include "SkTDynamicHash.h" |
19 | 19 |
20 /* | 20 /* |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 enum SaveLayerRecFlatFlags { | 120 enum SaveLayerRecFlatFlags { |
121 SAVELAYERREC_HAS_BOUNDS = 1 << 0, | 121 SAVELAYERREC_HAS_BOUNDS = 1 << 0, |
122 SAVELAYERREC_HAS_PAINT = 1 << 1, | 122 SAVELAYERREC_HAS_PAINT = 1 << 1, |
123 SAVELAYERREC_HAS_BACKDROP = 1 << 2, | 123 SAVELAYERREC_HAS_BACKDROP = 1 << 2, |
124 SAVELAYERREC_HAS_FLAGS = 1 << 3, | 124 SAVELAYERREC_HAS_FLAGS = 1 << 3, |
125 }; | 125 }; |
126 | 126 |
127 /////////////////////////////////////////////////////////////////////////////// | 127 /////////////////////////////////////////////////////////////////////////////// |
128 // clipparams are packed in 5 bits | 128 // clipparams are packed in 5 bits |
129 // doAA:1 | regionOp:4 | 129 // doAA:1 | clipOp:4 |
130 | 130 |
131 static inline uint32_t ClipParams_pack(SkRegion::Op op, bool doAA) { | 131 static inline uint32_t ClipParams_pack(SkCanvas::ClipOp op, bool doAA) { |
132 unsigned doAABit = doAA ? 1 : 0; | 132 unsigned doAABit = doAA ? 1 : 0; |
133 return (doAABit << 4) | op; | 133 return (doAABit << 4) | op; |
134 } | 134 } |
135 | 135 |
136 static inline SkRegion::Op ClipParams_unpackRegionOp(uint32_t packed) { | 136 static inline SkCanvas::ClipOp ClipParams_unpackRegionOp(uint32_t packed) { |
137 return (SkRegion::Op)(packed & 0xF); | 137 return (SkCanvas::ClipOp)(packed & 0xF); |
138 } | 138 } |
139 | 139 |
140 static inline bool ClipParams_unpackDoAA(uint32_t packed) { | 140 static inline bool ClipParams_unpackDoAA(uint32_t packed) { |
141 return SkToBool((packed >> 4) & 1); | 141 return SkToBool((packed >> 4) & 1); |
142 } | 142 } |
143 | 143 |
144 /////////////////////////////////////////////////////////////////////////////// | 144 /////////////////////////////////////////////////////////////////////////////// |
145 | 145 |
146 class SkTypefacePlayback { | 146 class SkTypefacePlayback { |
147 public: | 147 public: |
(...skipping 27 matching lines...) Expand all Loading... |
175 void setupBuffer(SkReadBuffer& buffer) const { | 175 void setupBuffer(SkReadBuffer& buffer) const { |
176 buffer.setFactoryPlayback(fArray, fCount); | 176 buffer.setFactoryPlayback(fArray, fCount); |
177 } | 177 } |
178 | 178 |
179 private: | 179 private: |
180 int fCount; | 180 int fCount; |
181 SkFlattenable::Factory* fArray; | 181 SkFlattenable::Factory* fArray; |
182 }; | 182 }; |
183 | 183 |
184 #endif | 184 #endif |
OLD | NEW |