OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #ifndef SkDumpCanvas_DEFINED | 8 #ifndef SkDumpCanvas_DEFINED |
9 #define SkDumpCanvas_DEFINED | 9 #define SkDumpCanvas_DEFINED |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 kDrawRRect_Verb, | 42 kDrawRRect_Verb, |
43 kDrawDRRect_Verb, | 43 kDrawDRRect_Verb, |
44 kDrawPath_Verb, | 44 kDrawPath_Verb, |
45 kDrawBitmap_Verb, | 45 kDrawBitmap_Verb, |
46 kDrawText_Verb, | 46 kDrawText_Verb, |
47 kDrawPicture_Verb, | 47 kDrawPicture_Verb, |
48 kDrawVertices_Verb, | 48 kDrawVertices_Verb, |
49 kDrawPatch_Verb, | 49 kDrawPatch_Verb, |
50 kDrawData_Verb, // obsolete | 50 kDrawData_Verb, // obsolete |
51 | 51 |
52 kBeginCommentGroup_Verb, | |
53 kAddComment_Verb, | |
54 kEndCommentGroup_Verb, | |
55 | |
56 kCull_Verb | 52 kCull_Verb |
57 }; | 53 }; |
58 | 54 |
59 /** Subclasses of this are installed on the DumpCanvas, and then called for | 55 /** Subclasses of this are installed on the DumpCanvas, and then called for |
60 each drawing command. | 56 each drawing command. |
61 */ | 57 */ |
62 class Dumper : public SkRefCnt { | 58 class Dumper : public SkRefCnt { |
63 public: | 59 public: |
64 SK_DECLARE_INST_COUNT(Dumper) | 60 SK_DECLARE_INST_COUNT(Dumper) |
65 | 61 |
66 virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[], | 62 virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[], |
67 const SkPaint*) = 0; | 63 const SkPaint*) = 0; |
68 | 64 |
69 private: | 65 private: |
70 typedef SkRefCnt INHERITED; | 66 typedef SkRefCnt INHERITED; |
71 }; | 67 }; |
72 | 68 |
73 Dumper* getDumper() const { return fDumper; } | 69 Dumper* getDumper() const { return fDumper; } |
74 void setDumper(Dumper*); | 70 void setDumper(Dumper*); |
75 | 71 |
76 int getNestLevel() const { return fNestLevel; } | 72 int getNestLevel() const { return fNestLevel; } |
77 | 73 |
78 void beginCommentGroup(const char* description) override; | |
79 void addComment(const char* kywd, const char* value) override; | |
80 void endCommentGroup() override; | |
81 | |
82 protected: | 74 protected: |
83 void willSave() override; | 75 void willSave() override; |
84 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) ov
erride; | 76 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) ov
erride; |
85 void willRestore() override; | 77 void willRestore() override; |
86 | 78 |
87 void didConcat(const SkMatrix&) override; | 79 void didConcat(const SkMatrix&) override; |
88 void didSetMatrix(const SkMatrix&) override; | 80 void didSetMatrix(const SkMatrix&) override; |
89 | 81 |
90 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; | 82 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; |
91 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS
calar y, | 83 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS
calar y, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 public: | 158 public: |
167 SkDebugfDumper(); | 159 SkDebugfDumper(); |
168 | 160 |
169 private: | 161 private: |
170 typedef SkFormatDumper INHERITED; | 162 typedef SkFormatDumper INHERITED; |
171 }; | 163 }; |
172 | 164 |
173 #endif | 165 #endif |
174 | 166 |
175 #endif | 167 #endif |
OLD | NEW |