| 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 |
| 11 #ifdef SK_DEVELOPER | 11 #ifdef SK_DEVELOPER |
| 12 #include "SkData.h" | |
| 13 #include "SkPatchUtils.h" | 12 #include "SkPatchUtils.h" |
| 14 #include "SkPicture.h" | 13 #include "SkPicture.h" |
| 15 #include "SkPixelRef.h" | 14 #include "SkPixelRef.h" |
| 16 #include "SkRRect.h" | 15 #include "SkRRect.h" |
| 17 #include "SkString.h" | 16 #include "SkString.h" |
| 18 #include "SkTextBlob.h" | 17 #include "SkTextBlob.h" |
| 19 #include <stdarg.h> | 18 #include <stdarg.h> |
| 20 #include <stdio.h> | 19 #include <stdio.h> |
| 21 | 20 |
| 22 // needed just to know that these are all subclassed from SkFlattenable | 21 // needed just to know that these are all subclassed from SkFlattenable |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 cubics[SkPatchUtils::kTopP3_CubicCtrlPts].fY, | 475 cubics[SkPatchUtils::kTopP3_CubicCtrlPts].fY, |
| 477 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fX, | 476 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fX, |
| 478 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fY, | 477 cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fY, |
| 479 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fX, | 478 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fX, |
| 480 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fY, | 479 cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fY, |
| 481 colors[0], colors[1], colors[2], colors[3], | 480 colors[0], colors[1], colors[2], colors[3], |
| 482 texCoords[0].x(), texCoords[0].y(), texCoords[1].x(), texCoords[1]
.y(), | 481 texCoords[0].x(), texCoords[0].y(), texCoords[1].x(), texCoords[1]
.y(), |
| 483 texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3]
.y()); | 482 texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3]
.y()); |
| 484 } | 483 } |
| 485 | 484 |
| 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 | |
| 493 /////////////////////////////////////////////////////////////////////////////// | 485 /////////////////////////////////////////////////////////////////////////////// |
| 494 /////////////////////////////////////////////////////////////////////////////// | 486 /////////////////////////////////////////////////////////////////////////////// |
| 495 | 487 |
| 496 SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) { | 488 SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) { |
| 497 fProc = proc; | 489 fProc = proc; |
| 498 fRefcon = refcon; | 490 fRefcon = refcon; |
| 499 } | 491 } |
| 500 | 492 |
| 501 static void appendPtr(SkString* str, const void* ptr, const char name[]) { | 493 static void appendPtr(SkString* str, const void* ptr, const char name[]) { |
| 502 if (ptr) { | 494 if (ptr) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 541 |
| 550 /////////////////////////////////////////////////////////////////////////////// | 542 /////////////////////////////////////////////////////////////////////////////// |
| 551 | 543 |
| 552 static void dumpToDebugf(const char text[], void*) { | 544 static void dumpToDebugf(const char text[], void*) { |
| 553 SkDebugf("%s\n", text); | 545 SkDebugf("%s\n", text); |
| 554 } | 546 } |
| 555 | 547 |
| 556 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} | 548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} |
| 557 | 549 |
| 558 #endif | 550 #endif |
| OLD | NEW |