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

Side by Side Diff: src/core/SkClipStack.cpp

Issue 311263015: Add dump() to SkClipStack to help with debugging. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add \n. Created 6 years, 6 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 | « include/core/SkRegion.h ('k') | src/core/SkPath.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 * 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
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:
883 SkDebugf("\n");
884 break;
885 case kRect_Type:
886 this->getRect().dump();
887 SkDebugf("\n");
888 break;
889 case kRRect_Type:
890 this->getRRect().dump();
891 SkDebugf("\n");
892 break;
893 case kPath_Type:
894 this->getPath().dump(true);
895 break;
896 }
897 }
898
899 void SkClipStack::dump() const {
900 B2TIter iter(*this);
901 const Element* e;
902 while ((e = iter.next())) {
903 e->dump();
904 SkDebugf("\n");
905 }
906 }
907 #endif
OLDNEW
« no previous file with comments | « include/core/SkRegion.h ('k') | src/core/SkPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698