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

Side by Side Diff: include/private/SkRecords.h

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « include/gpu/GrTypes.h ('k') | samplecode/SampleApp.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 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 RECORD3(SaveLayer, Optional<SkRect>, bounds, Optional<SkPaint>, paint, SkCanvas: :SaveFlags, flags); 240 RECORD3(SaveLayer, Optional<SkRect>, bounds, Optional<SkPaint>, paint, SkCanvas: :SaveFlags, flags);
241 241
242 RECORD1(SetMatrix, TypedMatrix, matrix); 242 RECORD1(SetMatrix, TypedMatrix, matrix);
243 243
244 struct RegionOpAndAA { 244 struct RegionOpAndAA {
245 RegionOpAndAA() {} 245 RegionOpAndAA() {}
246 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {} 246 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {}
247 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win today to do so. 247 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win today to do so.
248 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t his an unsigned. 248 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t his an unsigned.
249 }; 249 };
250 SK_COMPILE_ASSERT(sizeof(RegionOpAndAA) == 4, RegionOpAndAASize); 250 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize");
251 251
252 RECORD3(ClipPath, SkIRect, devBounds, PreCachedPath, path, RegionOpAndAA, opA A); 252 RECORD3(ClipPath, SkIRect, devBounds, PreCachedPath, path, RegionOpAndAA, opA A);
253 RECORD3(ClipRRect, SkIRect, devBounds, SkRRect, rrect, RegionOpAndAA, opA A); 253 RECORD3(ClipRRect, SkIRect, devBounds, SkRRect, rrect, RegionOpAndAA, opA A);
254 RECORD3(ClipRect, SkIRect, devBounds, SkRect, rect, RegionOpAndAA, opA A); 254 RECORD3(ClipRect, SkIRect, devBounds, SkRect, rect, RegionOpAndAA, opA A);
255 RECORD3(ClipRegion, SkIRect, devBounds, SkRegion, region, SkRegion::Op, o p); 255 RECORD3(ClipRegion, SkIRect, devBounds, SkRegion, region, SkRegion::Op, o p);
256 256
257 // While not strictly required, if you have an SkPaint, it's fastest to put it f irst. 257 // While not strictly required, if you have an SkPaint, it's fastest to put it f irst.
258 RECORD4(DrawBitmap, Optional<SkPaint>, paint, 258 RECORD4(DrawBitmap, Optional<SkPaint>, paint,
259 ImmutableBitmap, bitmap, 259 ImmutableBitmap, bitmap,
260 SkScalar, left, 260 SkScalar, left,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 #undef RECORD1 378 #undef RECORD1
379 #undef RECORD2 379 #undef RECORD2
380 #undef RECORD3 380 #undef RECORD3
381 #undef RECORD4 381 #undef RECORD4
382 #undef RECORD5 382 #undef RECORD5
383 #undef RECORD8 383 #undef RECORD8
384 384
385 } // namespace SkRecords 385 } // namespace SkRecords
386 386
387 #endif//SkRecords_DEFINED 387 #endif//SkRecords_DEFINED
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698