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