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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 void SkDumpCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y
, | 427 void SkDumpCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y
, |
428 const SkPaint& paint) { | 428 const SkPaint& paint) { |
429 SkString str; | 429 SkString str; |
430 toString(blob->bounds(), &str); | 430 toString(blob->bounds(), &str); |
431 this->dump(kDrawText_Verb, &paint, "drawTextBlob(%p) [%s]", blob, str.c_str(
)); | 431 this->dump(kDrawText_Verb, &paint, "drawTextBlob(%p) [%s]", blob, str.c_str(
)); |
432 // FIXME: dump the actual blob content? | 432 // FIXME: dump the actual blob content? |
433 } | 433 } |
434 | 434 |
435 void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, | 435 void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, |
436 const SkPaint* paint) { | 436 const SkPaint* paint) { |
437 this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", picture, | 437 this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %f:%f:%f:%f", picture, |
438 picture->width(), picture->height()); | 438 picture->cullRect().fLeft, picture->cullRect().fTop, |
| 439 picture->cullRect().fRight, picture->cullRect().fBottom); |
439 fNestLevel += 1; | 440 fNestLevel += 1; |
440 this->INHERITED::onDrawPicture(picture, matrix, paint); | 441 this->INHERITED::onDrawPicture(picture, matrix, paint); |
441 fNestLevel -= 1; | 442 fNestLevel -= 1; |
442 this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture, | 443 this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %f:%f:%f:%f", &picture, |
443 picture->width(), picture->height()); | 444 picture->cullRect().fLeft, picture->cullRect().fTop, |
| 445 picture->cullRect().fRight, picture->cullRect().fBottom); |
444 } | 446 } |
445 | 447 |
446 void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, | 448 void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, |
447 const SkPoint vertices[], const SkPoint texs[], | 449 const SkPoint vertices[], const SkPoint texs[], |
448 const SkColor colors[], SkXfermode* xmode, | 450 const SkColor colors[], SkXfermode* xmode, |
449 const uint16_t indices[], int indexCount, | 451 const uint16_t indices[], int indexCount, |
450 const SkPaint& paint) { | 452 const SkPaint& paint) { |
451 this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)", | 453 this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)", |
452 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), | 454 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), |
453 SkScalarToFloat(vertices[0].fY)); | 455 SkScalarToFloat(vertices[0].fY)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 552 |
551 /////////////////////////////////////////////////////////////////////////////// | 553 /////////////////////////////////////////////////////////////////////////////// |
552 | 554 |
553 static void dumpToDebugf(const char text[], void*) { | 555 static void dumpToDebugf(const char text[], void*) { |
554 SkDebugf("%s\n", text); | 556 SkDebugf("%s\n", text); |
555 } | 557 } |
556 | 558 |
557 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} | 559 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} |
558 | 560 |
559 #endif | 561 #endif |
OLD | NEW |