diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-18 15:14:33 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-18 15:14:33 +0000 |
commit | 7112173c3c4cd1b1e7da8cdf971d71f01dd91299 (patch) | |
tree | 854ffd9e48edda9dd70b2f7ad3d788000b8f7def /include/core | |
parent | acfb30e5bb797249f4ec41edda4c4d4b86e0e5d0 (diff) |
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
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkCanvas.h | 23 |
1 files changed, 20 insertions, 3 deletions
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); |