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

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

Issue 741093002: SkRecord: Pack SkRegion::Op and AA bit together. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MSVC, your whims are seemingly arbitrary. Created 6 years 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/SkRecorder.cpp ('k') | no next file » | 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 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 SkRecords_DEFINED 8 #ifndef SkRecords_DEFINED
9 #define SkRecords_DEFINED 9 #define SkRecords_DEFINED
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 RECORD2(Restore, SkIRect, devBounds, SkMatrix, matrix); 205 RECORD2(Restore, SkIRect, devBounds, SkMatrix, matrix);
206 RECORD0(Save); 206 RECORD0(Save);
207 RECORD3(SaveLayer, Optional<SkRect>, bounds, Optional<SkPaint>, paint, SkCanvas: :SaveFlags, flags); 207 RECORD3(SaveLayer, Optional<SkRect>, bounds, Optional<SkPaint>, paint, SkCanvas: :SaveFlags, flags);
208 208
209 RECORD1(PushCull, SkRect, rect); 209 RECORD1(PushCull, SkRect, rect);
210 RECORD0(PopCull); 210 RECORD0(PopCull);
211 211
212 RECORD1(SetMatrix, SkMatrix, matrix); 212 RECORD1(SetMatrix, SkMatrix, matrix);
213 213
214 RECORD4(ClipPath, SkIRect, devBounds, SkPath, path, SkRegion::Op, op, bool , doAA); 214 struct RegionOpAndAA {
215 RECORD4(ClipRRect, SkIRect, devBounds, SkRRect, rrect, SkRegion::Op, op, bool , doAA); 215 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {}
216 RECORD4(ClipRect, SkIRect, devBounds, SkRect, rect, SkRegion::Op, op, bool , doAA); 216 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win today to do so.
217 RECORD3(ClipRegion, SkIRect, devBounds, SkRegion, region, SkRegion::Op, op); 217 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t his an unsigned.
218 };
219 SK_COMPILE_ASSERT(sizeof(RegionOpAndAA) == 4, RegionOpAndAASize);
220
221 RECORD3(ClipPath, SkIRect, devBounds, SkPath, path, RegionOpAndAA, opAA);
222 RECORD3(ClipRRect, SkIRect, devBounds, SkRRect, rrect, RegionOpAndAA, opAA);
223 RECORD3(ClipRect, SkIRect, devBounds, SkRect, rect, RegionOpAndAA, opAA);
224 RECORD3(ClipRegion, SkIRect, devBounds, SkRegion, region, SkRegion::Op, op);
218 225
219 RECORD1(Clear, SkColor, color); 226 RECORD1(Clear, SkColor, color);
220 227
221 RECORD1(BeginCommentGroup, PODArray<char>, description); 228 RECORD1(BeginCommentGroup, PODArray<char>, description);
222 RECORD2(AddComment, PODArray<char>, key, PODArray<char>, value); 229 RECORD2(AddComment, PODArray<char>, key, PODArray<char>, value);
223 RECORD0(EndCommentGroup); 230 RECORD0(EndCommentGroup);
224 231
225 // While not strictly required, if you have an SkPaint, it's fastest to put it f irst. 232 // While not strictly required, if you have an SkPaint, it's fastest to put it f irst.
226 RECORD4(DrawBitmap, Optional<SkPaint>, paint, 233 RECORD4(DrawBitmap, Optional<SkPaint>, paint,
227 ImmutableBitmap, bitmap, 234 ImmutableBitmap, bitmap,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 #undef RECORD0 333 #undef RECORD0
327 #undef RECORD1 334 #undef RECORD1
328 #undef RECORD2 335 #undef RECORD2
329 #undef RECORD3 336 #undef RECORD3
330 #undef RECORD4 337 #undef RECORD4
331 #undef RECORD5 338 #undef RECORD5
332 339
333 } // namespace SkRecords 340 } // namespace SkRecords
334 341
335 #endif//SkRecords_DEFINED 342 #endif//SkRecords_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698