Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: src/utils/SkDumpCanvas.cpp

Issue 183453002: add new onClip* methods to SkCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: more cleanup Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 /////////////////////////////////////////////////////////////////////////////// 300 ///////////////////////////////////////////////////////////////////////////////
301 301
302 void SkDumpCanvas::drawPaint(const SkPaint& paint) { 302 void SkDumpCanvas::drawPaint(const SkPaint& paint) {
303 this->dump(kDrawPaint_Verb, &paint, "drawPaint()"); 303 this->dump(kDrawPaint_Verb, &paint, "drawPaint()");
304 } 304 }
305 305
306 void SkDumpCanvas::drawPoints(PointMode mode, size_t count, 306 void SkDumpCanvas::drawPoints(PointMode mode, size_t count,
307 const SkPoint pts[], const SkPaint& paint) { 307 const SkPoint pts[], const SkPaint& paint) {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 519
520 /////////////////////////////////////////////////////////////////////////////// 520 ///////////////////////////////////////////////////////////////////////////////
521 521
522 static void dumpToDebugf(const char text[], void*) { 522 static void dumpToDebugf(const char text[], void*) {
523 SkDebugf("%s\n", text); 523 SkDebugf("%s\n", text);
524 } 524 }
525 525
526 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} 526 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {}
527 527
528 #endif 528 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698