From 7112173c3c4cd1b1e7da8cdf971d71f01dd91299 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Tue, 18 Sep 2012 15:14:33 +0000 Subject: re-re-land 5578 will follow w/ new .skp files to keep the waterfall green (I hope) git-svn-id: http://skia.googlecode.com/svn/trunk@5584 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkCanvas.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'include/core') diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 1f29e1c00a..4696c9f20b 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -644,9 +644,26 @@ public: image will be drawn @param paint The paint used to draw the bitmap, or NULL */ - virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, - const SkRect& dst, const SkPaint* paint = NULL); + virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, + const SkRect& dst, + const SkPaint* paint); + + void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, + const SkPaint* paint) { + this->drawBitmapRectToRect(bitmap, NULL, dst, paint); + } + void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* isrc, + const SkRect& dst, const SkPaint* paint = NULL) { + SkRect realSrcStorage; + SkRect* realSrcPtr = NULL; + if (isrc) { + realSrcStorage.set(*isrc); + realSrcPtr = &realSrcStorage; + } + this->drawBitmapRectToRect(bitmap, realSrcPtr, dst, paint); + } + virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPaint* paint = NULL); @@ -993,7 +1010,7 @@ private: // canvas apis, without confusing subclasses (like SkPictureRecording) void internalDrawBitmap(const SkBitmap&, const SkIRect*, const SkMatrix& m, const SkPaint* paint); - void internalDrawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, + void internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint); void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint* paint); -- cgit v1.2.3