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

Unified Diff: src/gpu/GrPath.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/gpu/GrBatchFontCache.h ('k') | src/gpu/GrStrokeInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPath.cpp
diff --git a/src/gpu/GrPath.cpp b/src/gpu/GrPath.cpp
index 421edd32eaf52933e1f8b3b1d1d5923f7ae442df..4e1119dfbb45036f2a38cd9135006454364c29e2 100644
--- a/src/gpu/GrPath.cpp
+++ b/src/gpu/GrPath.cpp
@@ -18,8 +18,8 @@ inline static bool compute_key_for_line_path(const SkPath& path, const GrStrokeI
if (!path.isLine(pts)) {
return false;
}
- SK_COMPILE_ASSERT((sizeof(pts) % sizeof(uint32_t)) == 0 && sizeof(pts) > sizeof(uint32_t),
- pts_needs_padding);
+ static_assert((sizeof(pts) % sizeof(uint32_t)) == 0 && sizeof(pts) > sizeof(uint32_t),
+ "pts_needs_padding");
const int kBaseData32Cnt = 1 + sizeof(pts) / sizeof(uint32_t);
int strokeDataCnt = stroke.computeUniqueKeyFragmentData32Cnt();
@@ -39,8 +39,8 @@ inline static bool compute_key_for_oval_path(const SkPath& path, const GrStrokeI
if (!path.isOval(&rect)) {
return false;
}
- SK_COMPILE_ASSERT((sizeof(rect) % sizeof(uint32_t)) == 0 && sizeof(rect) > sizeof(uint32_t),
- rect_needs_padding);
+ static_assert((sizeof(rect) % sizeof(uint32_t)) == 0 && sizeof(rect) > sizeof(uint32_t),
+ "rect_needs_padding");
const int kBaseData32Cnt = 1 + sizeof(rect) / sizeof(uint32_t);
int strokeDataCnt = stroke.computeUniqueKeyFragmentData32Cnt();
@@ -69,8 +69,8 @@ inline static bool compute_key_for_simple_path(const SkPath& path, const GrStrok
}
// If somebody goes wild with the constant, it might cause an overflow.
- SK_COMPILE_ASSERT(kSimpleVolatilePathVerbLimit <= 100,
- big_simple_volatile_path_verb_limit_may_cause_overflow);
+ static_assert(kSimpleVolatilePathVerbLimit <= 100,
+ "big_simple_volatile_path_verb_limit_may_cause_overflow");
const int pointCnt = path.countPoints();
if (pointCnt < 0) {
@@ -121,8 +121,8 @@ inline static bool compute_key_for_simple_path(const SkPath& path, const GrStrok
path.getVerbs(reinterpret_cast<uint8_t*>(&builder[i]), verbCnt);
i += verbData32Cnt;
- SK_COMPILE_ASSERT(((sizeof(SkPoint) % sizeof(uint32_t)) == 0) &&
- sizeof(SkPoint) > sizeof(uint32_t), skpoint_array_needs_padding);
+ static_assert(((sizeof(SkPoint) % sizeof(uint32_t)) == 0) && sizeof(SkPoint) > sizeof(uint32_t),
+ "skpoint_array_needs_padding");
// Here we assume getPoints does a memcpy, so that we do not need to worry about the alignment.
path.getPoints(reinterpret_cast<SkPoint*>(&builder[i]), pointCnt);
« no previous file with comments | « src/gpu/GrBatchFontCache.h ('k') | src/gpu/GrStrokeInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698