OLD | NEW |
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 | 8 |
9 #include "SkDumpCanvas.h" | 9 #include "SkDumpCanvas.h" |
10 | 10 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 void SkDumpCanvas::setMatrix(const SkMatrix& matrix) { | 255 void SkDumpCanvas::setMatrix(const SkMatrix& matrix) { |
256 SkString str; | 256 SkString str; |
257 matrix.toString(&str); | 257 matrix.toString(&str); |
258 this->dump(kMatrix_Verb, NULL, "setMatrix(%s)", str.c_str()); | 258 this->dump(kMatrix_Verb, NULL, "setMatrix(%s)", str.c_str()); |
259 this->INHERITED::setMatrix(matrix); | 259 this->INHERITED::setMatrix(matrix); |
260 } | 260 } |
261 | 261 |
262 /////////////////////////////////////////////////////////////////////////////// | 262 /////////////////////////////////////////////////////////////////////////////// |
263 | 263 |
264 static const char* bool_to_aastring(bool doAA) { | 264 const char* SkDumpCanvas::EdgeStyleToAAString(ClipEdgeStyle edgeStyle) { |
265 return doAA ? "AA" : "BW"; | 265 return kSoft_ClipEdgeStyle == edgeStyle ? "AA" : "BW"; |
266 } | 266 } |
267 | 267 |
268 bool SkDumpCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { | 268 void SkDumpCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle
edgeStyle) { |
269 SkString str; | 269 SkString str; |
270 toString(rect, &str); | 270 toString(rect, &str); |
271 this->dump(kClip_Verb, NULL, "clipRect(%s %s %s)", str.c_str(), toString(op)
, | 271 this->dump(kClip_Verb, NULL, "clipRect(%s %s %s)", str.c_str(), toString(op)
, |
272 bool_to_aastring(doAA)); | 272 EdgeStyleToAAString(edgeStyle)); |
273 return this->INHERITED::clipRect(rect, op, doAA); | 273 this->INHERITED::onClipRect(rect, op, edgeStyle); |
274 } | 274 } |
275 | 275 |
276 bool SkDumpCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) { | 276 void SkDumpCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeSt
yle edgeStyle) { |
277 SkString str; | 277 SkString str; |
278 toString(rrect, &str); | 278 toString(rrect, &str); |
279 this->dump(kClip_Verb, NULL, "clipRRect(%s %s %s)", str.c_str(), toString(op
), | 279 this->dump(kClip_Verb, NULL, "clipRRect(%s %s %s)", str.c_str(), toString(op
), |
280 bool_to_aastring(doAA)); | 280 EdgeStyleToAAString(edgeStyle)); |
281 return this->INHERITED::clipRRect(rrect, op, doAA); | 281 this->INHERITED::onClipRRect(rrect, op, edgeStyle); |
282 } | 282 } |
283 | 283 |
284 bool SkDumpCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { | 284 void SkDumpCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle
edgeStyle) { |
285 SkString str; | 285 SkString str; |
286 toString(path, &str); | 286 toString(path, &str); |
287 this->dump(kClip_Verb, NULL, "clipPath(%s %s %s)", str.c_str(), toString(op)
, | 287 this->dump(kClip_Verb, NULL, "clipPath(%s %s %s)", str.c_str(), toString(op)
, |
288 bool_to_aastring(doAA)); | 288 EdgeStyleToAAString(edgeStyle)); |
289 return this->INHERITED::clipPath(path, op, doAA); | 289 this->INHERITED::onClipPath(path, op, edgeStyle); |
290 } | 290 } |
291 | 291 |
292 bool SkDumpCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 292 void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
293 SkString str; | 293 SkString str; |
294 toString(deviceRgn, &str); | 294 toString(deviceRgn, &str); |
295 this->dump(kClip_Verb, NULL, "clipRegion(%s %s)", str.c_str(), | 295 this->dump(kClip_Verb, NULL, "clipRegion(%s %s)", str.c_str(), |
296 toString(op)); | 296 toString(op)); |
297 return this->INHERITED::clipRegion(deviceRgn, op); | 297 this->INHERITED::onClipRegion(deviceRgn, op); |
298 } | 298 } |
299 | 299 |
300 void SkDumpCanvas::onPushCull(const SkRect& cullRect) { | 300 void SkDumpCanvas::onPushCull(const SkRect& cullRect) { |
301 SkString str; | 301 SkString str; |
302 toString(cullRect, &str); | 302 toString(cullRect, &str); |
303 this->dump(kCull_Verb, NULL, "pushCull(%s)", str.c_str()); | 303 this->dump(kCull_Verb, NULL, "pushCull(%s)", str.c_str()); |
304 } | 304 } |
305 | 305 |
306 void SkDumpCanvas::onPopCull() { | 306 void SkDumpCanvas::onPopCull() { |
307 this->dump(kCull_Verb, NULL, "popCull()"); | 307 this->dump(kCull_Verb, NULL, "popCull()"); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 528 |
529 /////////////////////////////////////////////////////////////////////////////// | 529 /////////////////////////////////////////////////////////////////////////////// |
530 | 530 |
531 static void dumpToDebugf(const char text[], void*) { | 531 static void dumpToDebugf(const char text[], void*) { |
532 SkDebugf("%s\n", text); | 532 SkDebugf("%s\n", text); |
533 } | 533 } |
534 | 534 |
535 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} | 535 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} |
536 | 536 |
537 #endif | 537 #endif |
OLD | NEW |