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 1758023003: Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/174410… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: manual rebase Created 4 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
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/utils/SkNWayCanvas.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
11 #ifdef SK_DEVELOPER 11 #ifdef SK_DEVELOPER
12 #include "SkData.h"
12 #include "SkPatchUtils.h" 13 #include "SkPatchUtils.h"
13 #include "SkPicture.h" 14 #include "SkPicture.h"
14 #include "SkPixelRef.h" 15 #include "SkPixelRef.h"
15 #include "SkRRect.h" 16 #include "SkRRect.h"
16 #include "SkString.h" 17 #include "SkString.h"
17 #include "SkTextBlob.h" 18 #include "SkTextBlob.h"
18 #include <stdarg.h> 19 #include <stdarg.h>
19 #include <stdio.h> 20 #include <stdio.h>
20 21
21 // needed just to know that these are all subclassed from SkFlattenable 22 // needed just to know that these are all subclassed from SkFlattenable
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 cubics[SkPatchUtils::kTopP3_CubicCtrlPts].fY, 476 cubics[SkPatchUtils::kTopP3_CubicCtrlPts].fY,
476 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fX, 477 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fX,
477 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fY, 478 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fY,
478 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fX, 479 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fX,
479 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fY, 480 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fY,
480 colors[0], colors[1], colors[2], colors[3], 481 colors[0], colors[1], colors[2], colors[3],
481 texCoords[0].x(), texCoords[0].y(), texCoords[1].x(), texCoords[1] .y(), 482 texCoords[0].x(), texCoords[0].y(), texCoords[1].x(), texCoords[1] .y(),
482 texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3] .y()); 483 texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3] .y());
483 } 484 }
484 485
486 void SkDumpCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData * value) {
487 SkString str;
488 toString(rect, &str);
489 this->dump(kDrawAnnotation_Verb, nullptr, "drawAnnotation(%s \"%s\" (%zu))",
490 str.c_str(), key, value ? value->size() : 0);
491 }
492
485 /////////////////////////////////////////////////////////////////////////////// 493 ///////////////////////////////////////////////////////////////////////////////
486 /////////////////////////////////////////////////////////////////////////////// 494 ///////////////////////////////////////////////////////////////////////////////
487 495
488 SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) { 496 SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) {
489 fProc = proc; 497 fProc = proc;
490 fRefcon = refcon; 498 fRefcon = refcon;
491 } 499 }
492 500
493 static void appendPtr(SkString* str, const void* ptr, const char name[]) { 501 static void appendPtr(SkString* str, const void* ptr, const char name[]) {
494 if (ptr) { 502 if (ptr) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 549
542 /////////////////////////////////////////////////////////////////////////////// 550 ///////////////////////////////////////////////////////////////////////////////
543 551
544 static void dumpToDebugf(const char text[], void*) { 552 static void dumpToDebugf(const char text[], void*) {
545 SkDebugf("%s\n", text); 553 SkDebugf("%s\n", text);
546 } 554 }
547 555
548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} 556 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {}
549 557
550 #endif 558 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/utils/SkNWayCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698