| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 4 * | 3 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #include "SkDumpCanvas.h" | 8 #include "SkDumpCanvas.h" |
| 10 | 9 |
| 11 #ifdef SK_DEVELOPER | 10 #ifdef SK_DEVELOPER |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 image->toString(&bs); | 385 image->toString(&bs); |
| 387 toString(dst, &rs); | 386 toString(dst, &rs); |
| 388 // show the src-rect only if its not everything | 387 // show the src-rect only if its not everything |
| 389 if (src && (src->fLeft > 0 || src->fTop > 0 || | 388 if (src && (src->fLeft > 0 || src->fTop > 0 || |
| 390 src->fRight < SkIntToScalar(image->width()) || | 389 src->fRight < SkIntToScalar(image->width()) || |
| 391 src->fBottom < SkIntToScalar(image->height()))) { | 390 src->fBottom < SkIntToScalar(image->height()))) { |
| 392 SkString ss; | 391 SkString ss; |
| 393 toString(*src, &ss); | 392 toString(*src, &ss); |
| 394 rs.prependf("%s ", ss.c_str()); | 393 rs.prependf("%s ", ss.c_str()); |
| 395 } | 394 } |
| 396 | 395 |
| 397 this->dump(kDrawBitmap_Verb, paint, "drawImageRectToRect(%s %s)", | 396 this->dump(kDrawBitmap_Verb, paint, "drawImageRectToRect(%s %s)", |
| 398 bs.c_str(), rs.c_str()); | 397 bs.c_str(), rs.c_str()); |
| 399 } | 398 } |
| 400 | 399 |
| 401 void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S
kScalar y, | 400 void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S
kScalar y, |
| 402 const SkPaint& paint) { | 401 const SkPaint& paint) { |
| 403 SkString str; | 402 SkString str; |
| 404 toString(text, byteLength, paint.getTextEncoding(), &str); | 403 toString(text, byteLength, paint.getTextEncoding(), &str); |
| 405 this->dump(kDrawText_Verb, &paint, "drawText(%s [%d] %g %g)", str.c_str(), | 404 this->dump(kDrawText_Verb, &paint, "drawText(%s [%d] %g %g)", str.c_str(), |
| 406 byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); | 405 byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 548 |
| 550 /////////////////////////////////////////////////////////////////////////////// | 549 /////////////////////////////////////////////////////////////////////////////// |
| 551 | 550 |
| 552 static void dumpToDebugf(const char text[], void*) { | 551 static void dumpToDebugf(const char text[], void*) { |
| 553 SkDebugf("%s\n", text); | 552 SkDebugf("%s\n", text); |
| 554 } | 553 } |
| 555 | 554 |
| 556 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} | 555 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} |
| 557 | 556 |
| 558 #endif | 557 #endif |
| OLD | NEW |