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 | |
407 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, |
408 const SkPaint& paint) { | 401 const SkPaint& paint) { |
409 SkString str; | 402 SkString str; |
410 toString(text, byteLength, paint.getTextEncoding(), &str); | 403 toString(text, byteLength, paint.getTextEncoding(), &str); |
411 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(), |
412 byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); | 405 byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); |
413 } | 406 } |
414 | 407 |
415 void SkDumpCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPo
int pos[], | 408 void SkDumpCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPo
int pos[], |
416 const SkPaint& paint) { | 409 const SkPaint& paint) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 541 |
549 /////////////////////////////////////////////////////////////////////////////// | 542 /////////////////////////////////////////////////////////////////////////////// |
550 | 543 |
551 static void dumpToDebugf(const char text[], void*) { | 544 static void dumpToDebugf(const char text[], void*) { |
552 SkDebugf("%s\n", text); | 545 SkDebugf("%s\n", text); |
553 } | 546 } |
554 | 547 |
555 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} | 548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} |
556 | 549 |
557 #endif | 550 #endif |
OLD | NEW |