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

Side by Side Diff: include/utils/SkDumpCanvas.h

Issue 13957009: First pass at Comment API (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/utils/SkProxyCanvas.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 /* 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 27 matching lines...) Expand all
38 kDrawPaint_Verb, 38 kDrawPaint_Verb,
39 kDrawPoints_Verb, 39 kDrawPoints_Verb,
40 kDrawOval_Verb, 40 kDrawOval_Verb,
41 kDrawRect_Verb, 41 kDrawRect_Verb,
42 kDrawRRect_Verb, 42 kDrawRRect_Verb,
43 kDrawPath_Verb, 43 kDrawPath_Verb,
44 kDrawBitmap_Verb, 44 kDrawBitmap_Verb,
45 kDrawText_Verb, 45 kDrawText_Verb,
46 kDrawPicture_Verb, 46 kDrawPicture_Verb,
47 kDrawVertices_Verb, 47 kDrawVertices_Verb,
48 kDrawData_Verb 48 kDrawData_Verb,
49
50 kBeginCommentGroup_Verb,
51 kAddComment_Verb,
52 kEndCommentGroup_Verb
49 }; 53 };
50 54
51 /** 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
52 each drawing command. 56 each drawing command.
53 */ 57 */
54 class Dumper : public SkRefCnt { 58 class Dumper : public SkRefCnt {
55 public: 59 public:
56 SK_DECLARE_INST_COUNT(Dumper) 60 SK_DECLARE_INST_COUNT(Dumper)
57 61
58 virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[], 62 virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[],
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 virtual void drawTextOnPath(const void* text, size_t byteLength, 114 virtual void drawTextOnPath(const void* text, size_t byteLength,
111 const SkPath& path, const SkMatrix* matrix, 115 const SkPath& path, const SkMatrix* matrix,
112 const SkPaint& paint) SK_OVERRIDE; 116 const SkPaint& paint) SK_OVERRIDE;
113 virtual void drawPicture(SkPicture&) SK_OVERRIDE; 117 virtual void drawPicture(SkPicture&) SK_OVERRIDE;
114 virtual void drawVertices(VertexMode vmode, int vertexCount, 118 virtual void drawVertices(VertexMode vmode, int vertexCount,
115 const SkPoint vertices[], const SkPoint texs[], 119 const SkPoint vertices[], const SkPoint texs[],
116 const SkColor colors[], SkXfermode* xmode, 120 const SkColor colors[], SkXfermode* xmode,
117 const uint16_t indices[], int indexCount, 121 const uint16_t indices[], int indexCount,
118 const SkPaint& paint) SK_OVERRIDE; 122 const SkPaint& paint) SK_OVERRIDE;
119 virtual void drawData(const void*, size_t) SK_OVERRIDE; 123 virtual void drawData(const void*, size_t) SK_OVERRIDE;
124 virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
125 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
126 virtual void endCommentGroup() SK_OVERRIDE;
120 127
121 private: 128 private:
122 Dumper* fDumper; 129 Dumper* fDumper;
123 int fNestLevel; // for nesting recursive elements like pictures 130 int fNestLevel; // for nesting recursive elements like pictures
124 131
125 void dump(Verb, const SkPaint*, const char format[], ...); 132 void dump(Verb, const SkPaint*, const char format[], ...);
126 133
127 typedef SkCanvas INHERITED; 134 typedef SkCanvas INHERITED;
128 }; 135 };
129 136
(...skipping 22 matching lines...) Expand all
152 public: 159 public:
153 SkDebugfDumper(); 160 SkDebugfDumper();
154 161
155 private: 162 private:
156 typedef SkFormatDumper INHERITED; 163 typedef SkFormatDumper INHERITED;
157 }; 164 };
158 165
159 #endif 166 #endif
160 167
161 #endif 168 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/utils/SkProxyCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698