Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: src/core/SkPictureFlat.h

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPictureAnalyzer.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/core/SkPictureAnalyzer.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698