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

Unified Diff: src/pdf/SkPDFDevice.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/images/SkScaledBitmapSampler.cpp ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index fa3bc4afcce6190fd86a09aed1db690e902cd7bc..179e02b8466117d298c811964f734f5e933e0fed 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -353,17 +353,12 @@ static bool calculate_inverse_path(const SkRect& bounds, const SkPath& invPath,
// enums so region_op_to_pathops_op can do a straight passthrough cast.
// If these are failing, it may be necessary to make region_op_to_pathops_op
// do more.
-SK_COMPILE_ASSERT(SkRegion::kDifference_Op == (int)kDifference_SkPathOp,
- region_pathop_mismatch);
-SK_COMPILE_ASSERT(SkRegion::kIntersect_Op == (int)kIntersect_SkPathOp,
- region_pathop_mismatch);
-SK_COMPILE_ASSERT(SkRegion::kUnion_Op == (int)kUnion_SkPathOp,
- region_pathop_mismatch);
-SK_COMPILE_ASSERT(SkRegion::kXOR_Op == (int)kXOR_SkPathOp,
- region_pathop_mismatch);
-SK_COMPILE_ASSERT(SkRegion::kReverseDifference_Op ==
- (int)kReverseDifference_SkPathOp,
- region_pathop_mismatch);
+static_assert(SkRegion::kDifference_Op == (int)kDifference_SkPathOp, "region_pathop_mismatch");
+static_assert(SkRegion::kIntersect_Op == (int)kIntersect_SkPathOp, "region_pathop_mismatch");
+static_assert(SkRegion::kUnion_Op == (int)kUnion_SkPathOp, "region_pathop_mismatch");
+static_assert(SkRegion::kXOR_Op == (int)kXOR_SkPathOp, "region_pathop_mismatch");
+static_assert(SkRegion::kReverseDifference_Op == (int)kReverseDifference_SkPathOp,
+ "region_pathop_mismatch");
static SkPathOp region_op_to_pathops_op(SkRegion::Op op) {
SkASSERT(op >= 0);
@@ -559,11 +554,9 @@ void GraphicStackState::updateDrawingState(const GraphicStateEntry& state) {
currentEntry()->fTextScaleX = state.fTextScaleX;
}
if (state.fTextFill != currentEntry()->fTextFill) {
- SK_COMPILE_ASSERT(SkPaint::kFill_Style == 0, enum_must_match_value);
- SK_COMPILE_ASSERT(SkPaint::kStroke_Style == 1,
- enum_must_match_value);
- SK_COMPILE_ASSERT(SkPaint::kStrokeAndFill_Style == 2,
- enum_must_match_value);
+ static_assert(SkPaint::kFill_Style == 0, "enum_must_match_value");
+ static_assert(SkPaint::kStroke_Style == 1, "enum_must_match_value");
+ static_assert(SkPaint::kStrokeAndFill_Style == 2, "enum_must_match_value");
fContentStream->writeDecAsText(state.fTextFill);
fContentStream->writeText(" Tr\n");
currentEntry()->fTextFill = state.fTextFill;
« no previous file with comments | « src/images/SkScaledBitmapSampler.cpp ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698