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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 src->fBottom < SkIntToScalar(bitmap.height()))) { | 366 src->fBottom < SkIntToScalar(bitmap.height()))) { |
367 SkString ss; | 367 SkString ss; |
368 toString(*src, &ss); | 368 toString(*src, &ss); |
369 rs.prependf("%s ", ss.c_str()); | 369 rs.prependf("%s ", ss.c_str()); |
370 } | 370 } |
371 | 371 |
372 this->dump(kDrawBitmap_Verb, paint, "drawBitmapRectToRect(%s %s)", | 372 this->dump(kDrawBitmap_Verb, paint, "drawBitmapRectToRect(%s %s)", |
373 bs.c_str(), rs.c_str()); | 373 bs.c_str(), rs.c_str()); |
374 } | 374 } |
375 | 375 |
376 void SkDumpCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, | |
377 const SkPaint* paint) { | |
378 SkString bs, ms; | |
379 bitmap.toString(&bs); | |
380 m.toString(&ms); | |
381 this->dump(kDrawBitmap_Verb, paint, "drawBitmapMatrix(%s %s)", | |
382 bs.c_str(), ms.c_str()); | |
383 } | |
384 | |
385 void SkDumpCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, | 376 void SkDumpCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, |
386 const SkPaint* paint) { | 377 const SkPaint* paint) { |
387 SkString str; | 378 SkString str; |
388 bitmap.toString(&str); | 379 bitmap.toString(&str); |
389 this->dump(kDrawBitmap_Verb, paint, "drawSprite(%s %d %d)", str.c_str(), | 380 this->dump(kDrawBitmap_Verb, paint, "drawSprite(%s %d %d)", str.c_str(), |
390 x, y); | 381 x, y); |
391 } | 382 } |
392 | 383 |
393 void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S
kScalar y, | 384 void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S
kScalar y, |
394 const SkPaint& paint) { | 385 const SkPaint& paint) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 543 |
553 /////////////////////////////////////////////////////////////////////////////// | 544 /////////////////////////////////////////////////////////////////////////////// |
554 | 545 |
555 static void dumpToDebugf(const char text[], void*) { | 546 static void dumpToDebugf(const char text[], void*) { |
556 SkDebugf("%s\n", text); | 547 SkDebugf("%s\n", text); |
557 } | 548 } |
558 | 549 |
559 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} | 550 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} |
560 | 551 |
561 #endif | 552 #endif |
OLD | NEW |