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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, | 435 void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, |
436 const SkPoint vertices[], const SkPoint texs[], | 436 const SkPoint vertices[], const SkPoint texs[], |
437 const SkColor colors[], SkXfermode* xmode, | 437 const SkColor colors[], SkXfermode* xmode, |
438 const uint16_t indices[], int indexCount, | 438 const uint16_t indices[], int indexCount, |
439 const SkPaint& paint) { | 439 const SkPaint& paint) { |
440 this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)", | 440 this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)", |
441 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), | 441 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), |
442 SkScalarToFloat(vertices[0].fY)); | 442 SkScalarToFloat(vertices[0].fY)); |
443 } | 443 } |
444 | 444 |
| 445 void SkDumpCanvas::drawPatch(const SkPatch& patch, const SkPaint& paint) { |
| 446 const SkPoint* points = patch.getControlPoints(); |
| 447 const SkColor* color = patch.getColors(); |
| 448 //dumps corner points and colors in clockwise order starting on upper-left c
orner |
| 449 this->dump(kDrawPatch_Verb, &paint, "drawPatch(Vertices{[%f, %f], [%f, %f],
[%f, %f], [%f, %f]}\ |
| 450 | Colors{[0x%x], [0x%x], [0x%x], [0x%x]})", |
| 451 points[SkPatch::kTopP0_CubicCtrlPts].fX, points[SkPatch::kTopP0_Cu
bicCtrlPts].fY, |
| 452 points[SkPatch::kTopP3_CubicCtrlPts].fX, points[SkPatch::kTopP3_Cu
bicCtrlPts].fY, |
| 453 points[SkPatch::kBottomP3_CubicCtrlPts].fX,points[SkPatch::kBottom
P3_CubicCtrlPts].fY, |
| 454 points[SkPatch::kBottomP0_CubicCtrlPts].fX,points[SkPatch::kBottom
P0_CubicCtrlPts].fY, |
| 455 color[0], color[1], color[2], color[3]); |
| 456 } |
| 457 |
445 void SkDumpCanvas::drawData(const void* data, size_t length) { | 458 void SkDumpCanvas::drawData(const void* data, size_t length) { |
446 // this->dump(kDrawData_Verb, NULL, "drawData(%d)", length); | 459 // this->dump(kDrawData_Verb, NULL, "drawData(%d)", length); |
447 this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length, | 460 this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length, |
448 SkTMin<size_t>(length, 64), data); | 461 SkTMin<size_t>(length, 64), data); |
449 } | 462 } |
450 | 463 |
451 void SkDumpCanvas::beginCommentGroup(const char* description) { | 464 void SkDumpCanvas::beginCommentGroup(const char* description) { |
452 this->dump(kBeginCommentGroup_Verb, NULL, "beginCommentGroup(%s)", descripti
on); | 465 this->dump(kBeginCommentGroup_Verb, NULL, "beginCommentGroup(%s)", descripti
on); |
453 } | 466 } |
454 | 467 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 532 |
520 /////////////////////////////////////////////////////////////////////////////// | 533 /////////////////////////////////////////////////////////////////////////////// |
521 | 534 |
522 static void dumpToDebugf(const char text[], void*) { | 535 static void dumpToDebugf(const char text[], void*) { |
523 SkDebugf("%s\n", text); | 536 SkDebugf("%s\n", text); |
524 } | 537 } |
525 | 538 |
526 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} | 539 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} |
527 | 540 |
528 #endif | 541 #endif |
OLD | NEW |