OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 | 8 |
9 | 9 |
10 #ifndef SKDEBUGCANVAS_H_ | 10 #ifndef SKDEBUGCANVAS_H_ |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } | 31 void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } |
32 bool getMegaVizMode() const { return fMegaVizMode; } | 32 bool getMegaVizMode() const { return fMegaVizMode; } |
33 | 33 |
34 /** | 34 /** |
35 * Enable or disable overdraw visualization | 35 * Enable or disable overdraw visualization |
36 */ | 36 */ |
37 void setOverdrawViz(bool overdrawViz); | 37 void setOverdrawViz(bool overdrawViz); |
38 bool getOverdrawViz() const { return fOverdrawViz; } | 38 bool getOverdrawViz() const { return fOverdrawViz; } |
39 | 39 |
| 40 /** |
| 41 * Set the color of the clip visualization. An alpha of zero renders the cli
p invisible. |
| 42 */ |
| 43 void setClipVizColor(SkColor clipVizColor) { this->fClipVizColor = clipVizCo
lor; } |
| 44 SkColor getClipVizColor() const { return fClipVizColor; } |
| 45 |
40 bool getAllowSimplifyClip() const { return fAllowSimplifyClip; } | 46 bool getAllowSimplifyClip() const { return fAllowSimplifyClip; } |
41 | 47 |
42 void setPicture(SkPicture* picture) { fPicture = picture; } | 48 void setPicture(SkPicture* picture) { fPicture = picture; } |
43 | 49 |
44 /** | 50 /** |
45 * Enable or disable texure filtering override | 51 * Enable or disable texure filtering override |
46 */ | 52 */ |
47 void overrideTexFiltering(bool overrideTexFiltering, SkFilterQuality); | 53 void overrideTexFiltering(bool overrideTexFiltering, SkFilterQuality); |
48 | 54 |
49 /** | 55 /** |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 */ | 140 */ |
135 void toggleCommand(int index, bool toggle); | 141 void toggleCommand(int index, bool toggle); |
136 | 142 |
137 void setUserMatrix(SkMatrix matrix) { | 143 void setUserMatrix(SkMatrix matrix) { |
138 fUserMatrix = matrix; | 144 fUserMatrix = matrix; |
139 } | 145 } |
140 | 146 |
141 SkString clipStackData() const { return fClipStackData; } | 147 SkString clipStackData() const { return fClipStackData; } |
142 | 148 |
143 /** | 149 /** |
144 Returns a JSON object representing up to N draws, where N is <= SkDebugC
anvas::getSize(). | 150 Returns a JSON object representing up to the Nth draw, where N is less t
han |
145 The encoder may use the UrlDataManager to store binary data such as imag
es, referring to | 151 SkDebugCanvas::getSize(). The encoder may use the UrlDataManager to stor
e binary data such |
146 them via URLs embedded in the JSON. | 152 as images, referring to them via URLs embedded in the JSON. |
147 */ | 153 */ |
148 Json::Value toJSON(UrlDataManager& urlDataManager, int n); | 154 Json::Value toJSON(UrlDataManager& urlDataManager, int n); |
149 | 155 |
150 //////////////////////////////////////////////////////////////////////////////// | 156 //////////////////////////////////////////////////////////////////////////////// |
151 // Inherited from SkCanvas | 157 // Inherited from SkCanvas |
152 //////////////////////////////////////////////////////////////////////////////// | 158 //////////////////////////////////////////////////////////////////////////////// |
153 | 159 |
154 static const int kVizImageHeight = 256; | 160 static const int kVizImageHeight = 256; |
155 static const int kVizImageWidth = 256; | 161 static const int kVizImageWidth = 256; |
156 | 162 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 SkMatrix fMatrix; | 237 SkMatrix fMatrix; |
232 SkIRect fClip; | 238 SkIRect fClip; |
233 | 239 |
234 SkString fClipStackData; | 240 SkString fClipStackData; |
235 bool fCalledAddStackData; | 241 bool fCalledAddStackData; |
236 SkPath fSaveDevPath; | 242 SkPath fSaveDevPath; |
237 | 243 |
238 bool fOverdrawViz; | 244 bool fOverdrawViz; |
239 bool fOverrideFilterQuality; | 245 bool fOverrideFilterQuality; |
240 SkFilterQuality fFilterQuality; | 246 SkFilterQuality fFilterQuality; |
| 247 SkColor fClipVizColor; |
241 | 248 |
242 SkAutoTUnref<SkNWayCanvas> fPaintFilterCanvas; | 249 SkAutoTUnref<SkNWayCanvas> fPaintFilterCanvas; |
243 | 250 |
244 /** | 251 /** |
245 The active saveLayer commands at a given point in the renderering. | 252 The active saveLayer commands at a given point in the renderering. |
246 Only used when "mega" visualization is enabled. | 253 Only used when "mega" visualization is enabled. |
247 */ | 254 */ |
248 SkTDArray<SkDrawCommand*> fActiveLayers; | 255 SkTDArray<SkDrawCommand*> fActiveLayers; |
249 | 256 |
250 /** | 257 /** |
(...skipping 17 matching lines...) Expand all Loading... |
268 void outputPoints(const SkPoint* pts, int count); | 275 void outputPoints(const SkPoint* pts, int count); |
269 void outputPointsCommon(const SkPoint* pts, int count); | 276 void outputPointsCommon(const SkPoint* pts, int count); |
270 void outputScalar(SkScalar num); | 277 void outputScalar(SkScalar num); |
271 | 278 |
272 void updatePaintFilterCanvas(); | 279 void updatePaintFilterCanvas(); |
273 | 280 |
274 typedef SkCanvas INHERITED; | 281 typedef SkCanvas INHERITED; |
275 }; | 282 }; |
276 | 283 |
277 #endif | 284 #endif |
OLD | NEW |