| 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 src->fBottom < SkIntToScalar(image->height()))) { | 390 src->fBottom < SkIntToScalar(image->height()))) { |
| 391 SkString ss; | 391 SkString ss; |
| 392 toString(*src, &ss); | 392 toString(*src, &ss); |
| 393 rs.prependf("%s ", ss.c_str()); | 393 rs.prependf("%s ", ss.c_str()); |
| 394 } | 394 } |
| 395 | 395 |
| 396 this->dump(kDrawBitmap_Verb, paint, "drawImageRectToRect(%s %s)", | 396 this->dump(kDrawBitmap_Verb, paint, "drawImageRectToRect(%s %s)", |
| 397 bs.c_str(), rs.c_str()); | 397 bs.c_str(), rs.c_str()); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void SkDumpCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPa
int* paint) { |
| 401 SkString str; |
| 402 bitmap.toString(&str); |
| 403 this->dump(kDrawBitmap_Verb, paint, "drawSprite(%s %d %d)", str.c_str(), |
| 404 x, y); |
| 405 } |
| 406 |
| 400 void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S
kScalar y, | 407 void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S
kScalar y, |
| 401 const SkPaint& paint) { | 408 const SkPaint& paint) { |
| 402 SkString str; | 409 SkString str; |
| 403 toString(text, byteLength, paint.getTextEncoding(), &str); | 410 toString(text, byteLength, paint.getTextEncoding(), &str); |
| 404 this->dump(kDrawText_Verb, &paint, "drawText(%s [%d] %g %g)", str.c_str(), | 411 this->dump(kDrawText_Verb, &paint, "drawText(%s [%d] %g %g)", str.c_str(), |
| 405 byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); | 412 byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); |
| 406 } | 413 } |
| 407 | 414 |
| 408 void SkDumpCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPo
int pos[], | 415 void SkDumpCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPo
int pos[], |
| 409 const SkPaint& paint) { | 416 const SkPaint& paint) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 548 |
| 542 /////////////////////////////////////////////////////////////////////////////// | 549 /////////////////////////////////////////////////////////////////////////////// |
| 543 | 550 |
| 544 static void dumpToDebugf(const char text[], void*) { | 551 static void dumpToDebugf(const char text[], void*) { |
| 545 SkDebugf("%s\n", text); | 552 SkDebugf("%s\n", text); |
| 546 } | 553 } |
| 547 | 554 |
| 548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} | 555 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} |
| 549 | 556 |
| 550 #endif | 557 #endif |
| OLD | NEW |