| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 void SkDumpCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, | 343 void SkDumpCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, |
| 344 const SkPaint* paint) { | 344 const SkPaint* paint) { |
| 345 SkString str; | 345 SkString str; |
| 346 bitmap.toString(&str); | 346 bitmap.toString(&str); |
| 347 this->dump(kDrawBitmap_Verb, paint, "drawBitmap(%s %g %g)", str.c_str(), | 347 this->dump(kDrawBitmap_Verb, paint, "drawBitmap(%s %g %g)", str.c_str(), |
| 348 SkScalarToFloat(x), SkScalarToFloat(y)); | 348 SkScalarToFloat(x), SkScalarToFloat(y)); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void SkDumpCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* sr
c, | 351 void SkDumpCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* sr
c, |
| 352 const SkRect& dst, const SkPaint* paint)
{ | 352 const SkRect& dst, const SkPaint* paint, |
| 353 DrawBitmapRectFlags flags) { |
| 353 SkString bs, rs; | 354 SkString bs, rs; |
| 354 bitmap.toString(&bs); | 355 bitmap.toString(&bs); |
| 355 toString(dst, &rs); | 356 toString(dst, &rs); |
| 356 // show the src-rect only if its not everything | 357 // show the src-rect only if its not everything |
| 357 if (src && (src->fLeft > 0 || src->fTop > 0 || | 358 if (src && (src->fLeft > 0 || src->fTop > 0 || |
| 358 src->fRight < SkIntToScalar(bitmap.width()) || | 359 src->fRight < SkIntToScalar(bitmap.width()) || |
| 359 src->fBottom < SkIntToScalar(bitmap.height()))) { | 360 src->fBottom < SkIntToScalar(bitmap.height()))) { |
| 360 SkString ss; | 361 SkString ss; |
| 361 toString(*src, &ss); | 362 toString(*src, &ss); |
| 362 rs.prependf("%s ", ss.c_str()); | 363 rs.prependf("%s ", ss.c_str()); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 517 |
| 517 /////////////////////////////////////////////////////////////////////////////// | 518 /////////////////////////////////////////////////////////////////////////////// |
| 518 | 519 |
| 519 static void dumpToDebugf(const char text[], void*) { | 520 static void dumpToDebugf(const char text[], void*) { |
| 520 SkDebugf("%s\n", text); | 521 SkDebugf("%s\n", text); |
| 521 } | 522 } |
| 522 | 523 |
| 523 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} | 524 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} |
| 524 | 525 |
| 525 #endif | 526 #endif |
| OLD | NEW |