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

Side by Side Diff: src/core/SkXfermode.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 unified diff | Download patch
« no previous file with comments | « src/core/SkVarAlloc.h ('k') | src/effects/SkDropShadowImageFilter.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkXfermode.h" 9 #include "SkXfermode.h"
10 #include "SkXfermode_proccoeff.h" 10 #include "SkXfermode_proccoeff.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 const char* SkXfermode::ModeName(Mode mode) { 959 const char* SkXfermode::ModeName(Mode mode) {
960 SkASSERT((unsigned) mode <= (unsigned)kLastMode); 960 SkASSERT((unsigned) mode <= (unsigned)kLastMode);
961 const char* gModeStrings[] = { 961 const char* gModeStrings[] = {
962 "Clear", "Src", "Dst", "SrcOver", "DstOver", "SrcIn", "DstIn", 962 "Clear", "Src", "Dst", "SrcOver", "DstOver", "SrcIn", "DstIn",
963 "SrcOut", "DstOut", "SrcATop", "DstATop", "Xor", "Plus", 963 "SrcOut", "DstOut", "SrcATop", "DstATop", "Xor", "Plus",
964 "Modulate", "Screen", "Overlay", "Darken", "Lighten", "ColorDodge", 964 "Modulate", "Screen", "Overlay", "Darken", "Lighten", "ColorDodge",
965 "ColorBurn", "HardLight", "SoftLight", "Difference", "Exclusion", 965 "ColorBurn", "HardLight", "SoftLight", "Difference", "Exclusion",
966 "Multiply", "Hue", "Saturation", "Color", "Luminosity" 966 "Multiply", "Hue", "Saturation", "Color", "Luminosity"
967 }; 967 };
968 return gModeStrings[mode]; 968 return gModeStrings[mode];
969 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gModeStrings) == kLastMode + 1, mode_count) ; 969 static_assert(SK_ARRAY_COUNT(gModeStrings) == kLastMode + 1, "mode_count");
970 } 970 }
971 971
972 #ifndef SK_IGNORE_TO_STRING 972 #ifndef SK_IGNORE_TO_STRING
973 void SkProcCoeffXfermode::toString(SkString* str) const { 973 void SkProcCoeffXfermode::toString(SkString* str) const {
974 str->append("SkProcCoeffXfermode: "); 974 str->append("SkProcCoeffXfermode: ");
975 975
976 str->append("mode: "); 976 str->append("mode: ");
977 str->append(ModeName(fMode)); 977 str->append(ModeName(fMode));
978 978
979 static const char* gCoeffStrings[kCoeffCount] = { 979 static const char* gCoeffStrings[kCoeffCount] = {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 if (!xfer) { 1094 if (!xfer) {
1095 return SkXfermode::kOpaque_SrcColorOpacity == opacityType; 1095 return SkXfermode::kOpaque_SrcColorOpacity == opacityType;
1096 } 1096 }
1097 1097
1098 return xfer->isOpaque(opacityType); 1098 return xfer->isOpaque(opacityType);
1099 } 1099 }
1100 1100
1101 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1101 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1102 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1102 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1103 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1103 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/core/SkVarAlloc.h ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698