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 "SkPath.h" | 15 #include "SkPath.h" |
16 #include "SkPathOps.h" | 16 #include "SkPathOps.h" |
17 #include "SkPicture.h" | 17 #include "SkPicture.h" |
18 #include "SkString.h" | 18 #include "SkString.h" |
19 #include "SkTArray.h" | 19 #include "SkTArray.h" |
| 20 #include "UrlDataManager.h" |
20 | 21 |
21 class SkNWayCanvas; | 22 class SkNWayCanvas; |
22 | 23 |
23 class SK_API SkDebugCanvas : public SkCanvas { | 24 class SK_API SkDebugCanvas : public SkCanvas { |
24 public: | 25 public: |
25 SkDebugCanvas(int width, int height); | 26 SkDebugCanvas(int width, int height); |
26 virtual ~SkDebugCanvas(); | 27 virtual ~SkDebugCanvas(); |
27 | 28 |
28 void toggleFilter(bool toggle) { fFilter = toggle; } | 29 void toggleFilter(bool toggle) { fFilter = toggle; } |
29 | 30 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 the value of toggle. | 133 the value of toggle. |
133 */ | 134 */ |
134 void toggleCommand(int index, bool toggle); | 135 void toggleCommand(int index, bool toggle); |
135 | 136 |
136 void setUserMatrix(SkMatrix matrix) { | 137 void setUserMatrix(SkMatrix matrix) { |
137 fUserMatrix = matrix; | 138 fUserMatrix = matrix; |
138 } | 139 } |
139 | 140 |
140 SkString clipStackData() const { return fClipStackData; } | 141 SkString clipStackData() const { return fClipStackData; } |
141 | 142 |
| 143 /** |
| 144 Returns a JSON object representing all of the draws. The encoder may use
the UrlDataManager |
| 145 to store binary data such as images, referring to them via URLs embedded
in the JSON. |
| 146 */ |
| 147 Json::Value toJSON(UrlDataManager& urlDataManager); |
| 148 |
142 //////////////////////////////////////////////////////////////////////////////// | 149 //////////////////////////////////////////////////////////////////////////////// |
143 // Inherited from SkCanvas | 150 // Inherited from SkCanvas |
144 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
145 | 152 |
146 static const int kVizImageHeight = 256; | 153 static const int kVizImageHeight = 256; |
147 static const int kVizImageWidth = 256; | 154 static const int kVizImageWidth = 256; |
148 | 155 |
149 bool isClipEmpty() const override { return false; } | 156 bool isClipEmpty() const override { return false; } |
150 bool isClipRect() const override { return true; } | 157 bool isClipRect() const override { return true; } |
151 bool getClipBounds(SkRect* bounds) const override { | 158 bool getClipBounds(SkRect* bounds) const override { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void outputPoints(const SkPoint* pts, int count); | 267 void outputPoints(const SkPoint* pts, int count); |
261 void outputPointsCommon(const SkPoint* pts, int count); | 268 void outputPointsCommon(const SkPoint* pts, int count); |
262 void outputScalar(SkScalar num); | 269 void outputScalar(SkScalar num); |
263 | 270 |
264 void updatePaintFilterCanvas(); | 271 void updatePaintFilterCanvas(); |
265 | 272 |
266 typedef SkCanvas INHERITED; | 273 typedef SkCanvas INHERITED; |
267 }; | 274 }; |
268 | 275 |
269 #endif | 276 #endif |
OLD | NEW |