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

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

Issue 13957009: First pass at Comment API (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 years, 6 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
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkProxyCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), 435 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX),
436 SkScalarToFloat(vertices[0].fY)); 436 SkScalarToFloat(vertices[0].fY));
437 } 437 }
438 438
439 void SkDumpCanvas::drawData(const void* data, size_t length) { 439 void SkDumpCanvas::drawData(const void* data, size_t length) {
440 // this->dump(kDrawData_Verb, NULL, "drawData(%d)", length); 440 // this->dump(kDrawData_Verb, NULL, "drawData(%d)", length);
441 this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length, 441 this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length,
442 SkMin32(length, 64), data); 442 SkMin32(length, 64), data);
443 } 443 }
444 444
445 void SkDumpCanvas::beginCommentGroup(const char* description) {
446 this->dump(kBeginCommentGroup_Verb, NULL, "beginCommentGroup(%s)", descripti on);
447 }
448
449 void SkDumpCanvas::addComment(const char* kywd, const char* value) {
450 this->dump(kAddComment_Verb, NULL, "addComment(%s, %s)", kywd, value);
451 }
452
453 void SkDumpCanvas::endCommentGroup() {
454 this->dump(kEndCommentGroup_Verb, NULL, "endCommentGroup()");
455 }
456
445 /////////////////////////////////////////////////////////////////////////////// 457 ///////////////////////////////////////////////////////////////////////////////
446 /////////////////////////////////////////////////////////////////////////////// 458 ///////////////////////////////////////////////////////////////////////////////
447 459
448 SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) { 460 SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) {
449 fProc = proc; 461 fProc = proc;
450 fRefcon = refcon; 462 fRefcon = refcon;
451 } 463 }
452 464
453 static void appendPtr(SkString* str, const void* ptr, const char name[]) { 465 static void appendPtr(SkString* str, const void* ptr, const char name[]) {
454 if (ptr) { 466 if (ptr) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 509
498 /////////////////////////////////////////////////////////////////////////////// 510 ///////////////////////////////////////////////////////////////////////////////
499 511
500 static void dumpToDebugf(const char text[], void*) { 512 static void dumpToDebugf(const char text[], void*) {
501 SkDebugf("%s\n", text); 513 SkDebugf("%s\n", text);
502 } 514 }
503 515
504 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} 516 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {}
505 517
506 #endif 518 #endif
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkProxyCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698