OLD | NEW |
---|---|
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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkClipStack.h" | 9 #include "SkClipStack.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
838 return kWideOpenGenID; | 838 return kWideOpenGenID; |
839 } | 839 } |
840 | 840 |
841 const Element* back = static_cast<const Element*>(fDeque.back()); | 841 const Element* back = static_cast<const Element*>(fDeque.back()); |
842 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is Empty()) { | 842 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is Empty()) { |
843 return kWideOpenGenID; | 843 return kWideOpenGenID; |
844 } | 844 } |
845 | 845 |
846 return back->getGenID(); | 846 return back->getGenID(); |
847 } | 847 } |
848 | |
849 #ifdef SK_DEVELOPER | |
850 void SkClipStack::Element::dump() const { | |
851 static const char* kTypeStrings[] = { | |
852 "empty", | |
853 "rect", | |
854 "rrect", | |
855 "path" | |
856 }; | |
857 SK_COMPILE_ASSERT(0 == kEmpty_Type, type_str); | |
858 SK_COMPILE_ASSERT(1 == kRect_Type, type_str); | |
859 SK_COMPILE_ASSERT(2 == kRRect_Type, type_str); | |
860 SK_COMPILE_ASSERT(3 == kPath_Type, type_str); | |
861 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kTypeStrings) == kTypeCnt, type_str); | |
862 | |
863 static const char* kOpStrings[] = { | |
864 "difference", | |
865 "intersect", | |
866 "union", | |
867 "xor", | |
868 "reverse-difference", | |
869 "replace", | |
870 }; | |
871 SK_COMPILE_ASSERT(0 == SkRegion::kDifference_Op, op_str); | |
872 SK_COMPILE_ASSERT(1 == SkRegion::kIntersect_Op, op_str); | |
873 SK_COMPILE_ASSERT(2 == SkRegion::kUnion_Op, op_str); | |
874 SK_COMPILE_ASSERT(3 == SkRegion::kXOR_Op, op_str); | |
875 SK_COMPILE_ASSERT(4 == SkRegion::kReverseDifference_Op, op_str); | |
876 SK_COMPILE_ASSERT(5 == SkRegion::kReplace_Op, op_str); | |
877 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kOpStrings) == SkRegion::kOpCnt, op_str); | |
878 | |
879 SkDebugf("Type: %s, Op: %s, AA: %s, Save Count: %d\n", kTypeStrings[fType], | |
880 kOpStrings[fOp], (fDoAA ? "yes" : "no"), fSaveCount); | |
881 switch (fType) { | |
882 case kEmpty_Type: | |
robertphillips
2014/06/08 19:48:31
SkDebugf("\n"); here ?
bsalomon
2014/06/09 13:29:42
Yeah, I think so.
| |
883 break; | |
884 case kRect_Type: | |
885 this->getRect().dump(); | |
886 SkDebugf("\n"); | |
887 break; | |
888 case kRRect_Type: | |
889 this->getRRect().dump(); | |
890 SkDebugf("\n"); | |
891 break; | |
892 case kPath_Type: | |
893 this->getPath().dump(true); | |
894 break; | |
895 } | |
896 } | |
897 | |
898 void SkClipStack::dump() const { | |
899 B2TIter iter(*this); | |
900 const Element* e; | |
901 while ((e = iter.next())) { | |
902 e->dump(); | |
903 SkDebugf("\n"); | |
904 } | |
905 } | |
906 #endif | |
OLD | NEW |