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

Unified 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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecords.h
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h
index d303e9891579e109eef87ca5929d9b614502e236..da0c884ae2dd8b6bfd76828522c3d550f7af0105 100644
--- a/src/core/SkRecords.h
+++ b/src/core/SkRecords.h
@@ -211,10 +211,17 @@ RECORD0(PopCull);
RECORD1(SetMatrix, SkMatrix, matrix);
-RECORD4(ClipPath, SkIRect, devBounds, SkPath, path, SkRegion::Op, op, bool, doAA);
-RECORD4(ClipRRect, SkIRect, devBounds, SkRRect, rrect, SkRegion::Op, op, bool, doAA);
-RECORD4(ClipRect, SkIRect, devBounds, SkRect, rect, SkRegion::Op, op, bool, doAA);
-RECORD3(ClipRegion, SkIRect, devBounds, SkRegion, region, SkRegion::Op, op);
+struct RegionOpAndAA {
+ RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {}
+ SkRegion::Op op : 31; // This really only needs to be 3, but there's no win today to do so.
+ unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call this an unsigned.
+};
+SK_COMPILE_ASSERT(sizeof(RegionOpAndAA) == 4, RegionOpAndAASize);
+
+RECORD3(ClipPath, SkIRect, devBounds, SkPath, path, RegionOpAndAA, opAA);
+RECORD3(ClipRRect, SkIRect, devBounds, SkRRect, rrect, RegionOpAndAA, opAA);
+RECORD3(ClipRect, SkIRect, devBounds, SkRect, rect, RegionOpAndAA, opAA);
+RECORD3(ClipRegion, SkIRect, devBounds, SkRegion, region, SkRegion::Op, op);
RECORD1(Clear, SkColor, color);
« 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