diff options
author | 2012-09-18 12:59:44 +0000 | |
---|---|---|
committer | 2012-09-18 12:59:44 +0000 | |
commit | f1ab723033a186dc53434104a636c2dfac5fc863 (patch) | |
tree | b3e9f1224fdaa890072b22a953df589fdb80fd58 /src/core/SkPictureRecord.cpp | |
parent | 54339a826e460c2371f946224cca4db8482d8f5b (diff) |
Change drawBitmapRect to take a float-src-rect instead of integer-src-rect. This
allows the client more control over the scaling. Because of virtual overrides
and wanting to keep the old call-sites up and running, this CL renames the
virtual entry-point to drawBitmapRectToRect, and downgrades drawBitmapRect to
a non-virtual helper function.
The implementation is to use the float-rect for computing the matrix, but still
cons-up an integer rect for the purposes of subsetting the original bitmap. We
do this by calling float_src->roundOut(&int_src) so that we include all
(partially) covered src pixels.
No change needed on SkDevice, since that signature is explicitly passed the
computed matrix.
Review URL: https://codereview.appspot.com/6501140
git-svn-id: http://skia.googlecode.com/svn/trunk@5578 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r-- | src/core/SkPictureRecord.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index 73a3ab549a..944fd1898f 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -426,12 +426,12 @@ void SkPictureRecord::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar validate(); } -void SkPictureRecord::drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, +void SkPictureRecord::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint) { - addDraw(DRAW_BITMAP_RECT); + addDraw(DRAW_BITMAP_RECT_TO_RECT); addPaintPtr(paint); addBitmap(bitmap); - addIRectPtr(src); // may be null + addRectPtr(src); // may be null addRect(dst); validate(); } |