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

Side by Side Diff: src/core/SkClipStack.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/SkCanvas.cpp ('k') | src/core/SkConvolver.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkClipStack.h" 10 #include "SkClipStack.h"
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 } 855 }
856 856
857 #ifdef SK_DEVELOPER 857 #ifdef SK_DEVELOPER
858 void SkClipStack::Element::dump() const { 858 void SkClipStack::Element::dump() const {
859 static const char* kTypeStrings[] = { 859 static const char* kTypeStrings[] = {
860 "empty", 860 "empty",
861 "rect", 861 "rect",
862 "rrect", 862 "rrect",
863 "path" 863 "path"
864 }; 864 };
865 SK_COMPILE_ASSERT(0 == kEmpty_Type, type_str); 865 static_assert(0 == kEmpty_Type, "type_str");
866 SK_COMPILE_ASSERT(1 == kRect_Type, type_str); 866 static_assert(1 == kRect_Type, "type_str");
867 SK_COMPILE_ASSERT(2 == kRRect_Type, type_str); 867 static_assert(2 == kRRect_Type, "type_str");
868 SK_COMPILE_ASSERT(3 == kPath_Type, type_str); 868 static_assert(3 == kPath_Type, "type_str");
869 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kTypeStrings) == kTypeCnt, type_str); 869 static_assert(SK_ARRAY_COUNT(kTypeStrings) == kTypeCnt, "type_str");
870 870
871 static const char* kOpStrings[] = { 871 static const char* kOpStrings[] = {
872 "difference", 872 "difference",
873 "intersect", 873 "intersect",
874 "union", 874 "union",
875 "xor", 875 "xor",
876 "reverse-difference", 876 "reverse-difference",
877 "replace", 877 "replace",
878 }; 878 };
879 SK_COMPILE_ASSERT(0 == SkRegion::kDifference_Op, op_str); 879 static_assert(0 == SkRegion::kDifference_Op, "op_str");
880 SK_COMPILE_ASSERT(1 == SkRegion::kIntersect_Op, op_str); 880 static_assert(1 == SkRegion::kIntersect_Op, "op_str");
881 SK_COMPILE_ASSERT(2 == SkRegion::kUnion_Op, op_str); 881 static_assert(2 == SkRegion::kUnion_Op, "op_str");
882 SK_COMPILE_ASSERT(3 == SkRegion::kXOR_Op, op_str); 882 static_assert(3 == SkRegion::kXOR_Op, "op_str");
883 SK_COMPILE_ASSERT(4 == SkRegion::kReverseDifference_Op, op_str); 883 static_assert(4 == SkRegion::kReverseDifference_Op, "op_str");
884 SK_COMPILE_ASSERT(5 == SkRegion::kReplace_Op, op_str); 884 static_assert(5 == SkRegion::kReplace_Op, "op_str");
885 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kOpStrings) == SkRegion::kOpCnt, op_str); 885 static_assert(SK_ARRAY_COUNT(kOpStrings) == SkRegion::kOpCnt, "op_str");
886 886
887 SkDebugf("Type: %s, Op: %s, AA: %s, Save Count: %d\n", kTypeStrings[fType], 887 SkDebugf("Type: %s, Op: %s, AA: %s, Save Count: %d\n", kTypeStrings[fType],
888 kOpStrings[fOp], (fDoAA ? "yes" : "no"), fSaveCount); 888 kOpStrings[fOp], (fDoAA ? "yes" : "no"), fSaveCount);
889 switch (fType) { 889 switch (fType) {
890 case kEmpty_Type: 890 case kEmpty_Type:
891 SkDebugf("\n"); 891 SkDebugf("\n");
892 break; 892 break;
893 case kRect_Type: 893 case kRect_Type:
894 this->getRect().dump(); 894 this->getRect().dump();
895 SkDebugf("\n"); 895 SkDebugf("\n");
(...skipping 10 matching lines...) Expand all
906 906
907 void SkClipStack::dump() const { 907 void SkClipStack::dump() const {
908 B2TIter iter(*this); 908 B2TIter iter(*this);
909 const Element* e; 909 const Element* e;
910 while ((e = iter.next())) { 910 while ((e = iter.next())) {
911 e->dump(); 911 e->dump();
912 SkDebugf("\n"); 912 SkDebugf("\n");
913 } 913 }
914 } 914 }
915 #endif 915 #endif
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkConvolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698