| 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_ |
| 11 #define SKDEBUGCANVAS_H_ | 11 #define SKDEBUGCANVAS_H_ |
| 12 | 12 |
| 13 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
| 14 #include "SkDrawCommand.h" | 14 #include "SkDrawCommand.h" |
| 15 #include "SkPicture.h" | 15 #include "SkPicture.h" |
| 16 #include "SkTArray.h" | 16 #include "SkTArray.h" |
| 17 #include "SkString.h" | 17 #include "SkString.h" |
| 18 | 18 |
| 19 class SkTexOverrideFilter; | 19 class SkTexOverrideFilter; |
| 20 | 20 |
| 21 class SK_API SkDebugCanvas : public SkCanvas { | 21 class SK_API SkDebugCanvas : public SkCanvas { |
| 22 public: | 22 public: |
| 23 SkDebugCanvas(int width, int height); | 23 SkDebugCanvas(int width, int height); |
| 24 virtual ~SkDebugCanvas(); | 24 virtual ~SkDebugCanvas(); |
| 25 | 25 |
| 26 void toggleFilter(bool toggle); | 26 void toggleFilter(bool toggle) { fFilter = toggle; } |
| 27 |
| 28 void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } |
| 27 | 29 |
| 28 /** | 30 /** |
| 29 * Enable or disable overdraw visualization | 31 * Enable or disable overdraw visualization |
| 30 */ | 32 */ |
| 31 void setOverdrawViz(bool overdrawViz) { fOverdrawViz = overdrawViz; } | 33 void setOverdrawViz(bool overdrawViz) { fOverdrawViz = overdrawViz; } |
| 32 | 34 |
| 33 /** | 35 /** |
| 34 * Enable or disable texure filtering override | 36 * Enable or disable texure filtering override |
| 35 */ | 37 */ |
| 36 void overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel le
vel); | 38 void overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel le
vel); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 protected: | 247 protected: |
| 246 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; | 248 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; |
| 247 virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE; | 249 virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE; |
| 248 virtual void onPopCull() SK_OVERRIDE; | 250 virtual void onPopCull() SK_OVERRIDE; |
| 249 | 251 |
| 250 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 252 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 251 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; | 253 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; |
| 252 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 254 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 253 virtual void onClipRegion(const SkRegion& region, SkRegion::Op) SK_OVERRIDE; | 255 virtual void onClipRegion(const SkRegion& region, SkRegion::Op) SK_OVERRIDE; |
| 254 | 256 |
| 257 void markActiveSaveLayers(int index); |
| 258 |
| 255 private: | 259 private: |
| 256 SkTDArray<SkDrawCommand*> fCommandVector; | 260 SkTDArray<SkDrawCommand*> fCommandVector; |
| 257 int fWidth; | 261 int fWidth; |
| 258 int fHeight; | 262 int fHeight; |
| 259 bool fFilter; | 263 bool fFilter; |
| 264 bool fMegaVizMode; |
| 260 int fIndex; | 265 int fIndex; |
| 261 SkMatrix fUserMatrix; | 266 SkMatrix fUserMatrix; |
| 262 SkMatrix fMatrix; | 267 SkMatrix fMatrix; |
| 263 SkIRect fClip; | 268 SkIRect fClip; |
| 264 | 269 |
| 265 bool fOverdrawViz; | 270 bool fOverdrawViz; |
| 266 SkDrawFilter* fOverdrawFilter; | 271 SkDrawFilter* fOverdrawFilter; |
| 267 | 272 |
| 268 bool fOverrideTexFiltering; | 273 bool fOverrideTexFiltering; |
| 269 SkTexOverrideFilter* fTexOverrideFilter; | 274 SkTexOverrideFilter* fTexOverrideFilter; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 285 /** | 290 /** |
| 286 Applies any panning and zooming the user has specified before | 291 Applies any panning and zooming the user has specified before |
| 287 drawing anything else into the canvas. | 292 drawing anything else into the canvas. |
| 288 */ | 293 */ |
| 289 void applyUserTransform(SkCanvas* canvas); | 294 void applyUserTransform(SkCanvas* canvas); |
| 290 | 295 |
| 291 typedef SkCanvas INHERITED; | 296 typedef SkCanvas INHERITED; |
| 292 }; | 297 }; |
| 293 | 298 |
| 294 #endif | 299 #endif |
| OLD | NEW |