| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } | 29 void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } |
| 30 bool getMegaVizMode() const { return fMegaVizMode; } | 30 bool getMegaVizMode() const { return fMegaVizMode; } |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Enable or disable overdraw visualization | 33 * Enable or disable overdraw visualization |
| 34 */ | 34 */ |
| 35 void setOverdrawViz(bool overdrawViz) { fOverdrawViz = overdrawViz; } | 35 void setOverdrawViz(bool overdrawViz) { fOverdrawViz = overdrawViz; } |
| 36 bool getOverdrawViz() const { return fOverdrawViz; } | 36 bool getOverdrawViz() const { return fOverdrawViz; } |
| 37 | 37 |
| 38 void setOutstandingSaveCount(int saveCount) { fOutstandingSaveCount = saveCo
unt; } | |
| 39 int getOutstandingSaveCount() const { return fOutstandingSaveCount; } | |
| 40 | |
| 41 bool getAllowSimplifyClip() const { return fAllowSimplifyClip; } | 38 bool getAllowSimplifyClip() const { return fAllowSimplifyClip; } |
| 42 | 39 |
| 43 void setPicture(SkPicture* picture) { fPicture = picture; } | 40 void setPicture(SkPicture* picture) { fPicture = picture; } |
| 44 | 41 |
| 45 /** | 42 /** |
| 46 * Enable or disable texure filtering override | 43 * Enable or disable texure filtering override |
| 47 */ | 44 */ |
| 48 void overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel le
vel); | 45 void overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel le
vel); |
| 49 | 46 |
| 50 /** | 47 /** |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 127 } |
| 131 | 128 |
| 132 /** | 129 /** |
| 133 Toggles the visibility / execution of the draw command at index i with | 130 Toggles the visibility / execution of the draw command at index i with |
| 134 the value of toggle. | 131 the value of toggle. |
| 135 */ | 132 */ |
| 136 void toggleCommand(int index, bool toggle); | 133 void toggleCommand(int index, bool toggle); |
| 137 | 134 |
| 138 void setUserMatrix(SkMatrix matrix) { | 135 void setUserMatrix(SkMatrix matrix) { |
| 139 fUserMatrix = matrix; | 136 fUserMatrix = matrix; |
| 140 fDrawNeedsReset = true; | |
| 141 } | 137 } |
| 142 | 138 |
| 143 SkString clipStackData() const { return fClipStackData; } | 139 SkString clipStackData() const { return fClipStackData; } |
| 144 | 140 |
| 145 //////////////////////////////////////////////////////////////////////////////// | 141 //////////////////////////////////////////////////////////////////////////////// |
| 146 // Inherited from SkCanvas | 142 // Inherited from SkCanvas |
| 147 //////////////////////////////////////////////////////////////////////////////// | 143 //////////////////////////////////////////////////////////////////////////////// |
| 148 | 144 |
| 149 void beginCommentGroup(const char* description) SK_OVERRIDE; | 145 void beginCommentGroup(const char* description) SK_OVERRIDE; |
| 150 void addComment(const char* kywd, const char* value) SK_OVERRIDE; | 146 void addComment(const char* kywd, const char* value) SK_OVERRIDE; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 214 |
| 219 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVE
RRIDE; | 215 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVE
RRIDE; |
| 220 | 216 |
| 221 void markActiveCommands(int index); | 217 void markActiveCommands(int index); |
| 222 | 218 |
| 223 private: | 219 private: |
| 224 SkTDArray<SkDrawCommand*> fCommandVector; | 220 SkTDArray<SkDrawCommand*> fCommandVector; |
| 225 SkPicture* fPicture; | 221 SkPicture* fPicture; |
| 226 bool fFilter; | 222 bool fFilter; |
| 227 bool fMegaVizMode; | 223 bool fMegaVizMode; |
| 228 int fIndex; | |
| 229 SkMatrix fUserMatrix; | 224 SkMatrix fUserMatrix; |
| 230 bool fDrawNeedsReset; // fUserMatrix has changed so the incremental draw
won't work | |
| 231 SkMatrix fMatrix; | 225 SkMatrix fMatrix; |
| 232 SkIRect fClip; | 226 SkIRect fClip; |
| 233 | 227 |
| 234 SkString fClipStackData; | 228 SkString fClipStackData; |
| 235 bool fCalledAddStackData; | 229 bool fCalledAddStackData; |
| 236 SkPath fSaveDevPath; | 230 SkPath fSaveDevPath; |
| 237 | 231 |
| 238 bool fOverdrawViz; | 232 bool fOverdrawViz; |
| 239 SkDrawFilter* fOverdrawFilter; | 233 SkDrawFilter* fOverdrawFilter; |
| 240 | 234 |
| 241 bool fOverrideTexFiltering; | 235 bool fOverrideTexFiltering; |
| 242 SkTexOverrideFilter* fTexOverrideFilter; | 236 SkTexOverrideFilter* fTexOverrideFilter; |
| 243 | 237 |
| 244 /** | 238 /** |
| 245 Number of unmatched save() calls at any point during a draw. | |
| 246 If there are any saveLayer() calls outstanding, we need to resolve | |
| 247 all of them, which in practice means resolving all save() calls, | |
| 248 to avoid corruption of our canvas. | |
| 249 */ | |
| 250 int fOutstandingSaveCount; | |
| 251 | |
| 252 /** | |
| 253 The active saveLayer commands at a given point in the renderering. | 239 The active saveLayer commands at a given point in the renderering. |
| 254 Only used when "mega" visualization is enabled. | 240 Only used when "mega" visualization is enabled. |
| 255 */ | 241 */ |
| 256 SkTDArray<SkDrawCommand*> fActiveLayers; | 242 SkTDArray<SkDrawCommand*> fActiveLayers; |
| 257 | 243 |
| 258 /** | 244 /** |
| 259 Adds the command to the classes vector of commands. | 245 Adds the command to the classes vector of commands. |
| 260 @param command The draw command for execution | 246 @param command The draw command for execution |
| 261 */ | 247 */ |
| 262 void addDrawCommand(SkDrawCommand* command); | 248 void addDrawCommand(SkDrawCommand* command); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 283 bool lastClipStackData(const SkPath& devPath); | 269 bool lastClipStackData(const SkPath& devPath); |
| 284 void outputConicPoints(const SkPoint* pts, SkScalar weight); | 270 void outputConicPoints(const SkPoint* pts, SkScalar weight); |
| 285 void outputPoints(const SkPoint* pts, int count); | 271 void outputPoints(const SkPoint* pts, int count); |
| 286 void outputPointsCommon(const SkPoint* pts, int count); | 272 void outputPointsCommon(const SkPoint* pts, int count); |
| 287 void outputScalar(SkScalar num); | 273 void outputScalar(SkScalar num); |
| 288 | 274 |
| 289 typedef SkCanvas INHERITED; | 275 typedef SkCanvas INHERITED; |
| 290 }; | 276 }; |
| 291 | 277 |
| 292 #endif | 278 #endif |
| OLD | NEW |