Index: include/core/SkCanvas.h |
=================================================================== |
--- include/core/SkCanvas.h (revision 10709) |
+++ include/core/SkCanvas.h (working copy) |
@@ -673,6 +673,16 @@ |
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
const SkPaint* paint = NULL); |
+ enum DrawBitmapRectFlags { |
+ kNone_DrawBitmapRectflag = 0x0, |
reed1
2013/08/14 15:50:56
nit: flag should be Flag
|
+ /** |
+ * When filtering is enabled, allow the color samples outside of |
+ * the src rect (but still in the src bitmap) to bleed into the |
+ * drawn portion |
+ */ |
+ kBleed_DrawBitmapRectFlag = 0x1, |
+ }; |
+ |
/** Draw the specified bitmap, with the specified matrix applied (before the |
canvas' matrix is applied). |
@param bitmap The bitmap to be drawn |
@@ -683,22 +693,24 @@ |
*/ |
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, |
const SkRect& dst, |
- const SkPaint* paint); |
+ const SkPaint* paint = NULL, |
+ DrawBitmapRectFlags flags = kNone_DrawBitmapRectflag); |
void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, |
- const SkPaint* paint) { |
- this->drawBitmapRectToRect(bitmap, NULL, dst, paint); |
+ const SkPaint* paint = NULL) { |
+ this->drawBitmapRectToRect(bitmap, NULL, dst, paint, kNone_DrawBitmapRectflag); |
} |
void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* isrc, |
- const SkRect& dst, const SkPaint* paint = NULL) { |
+ const SkRect& dst, const SkPaint* paint = NULL, |
+ DrawBitmapRectFlags flags = kNone_DrawBitmapRectflag) { |
SkRect realSrcStorage; |
SkRect* realSrcPtr = NULL; |
if (isrc) { |
realSrcStorage.set(*isrc); |
realSrcPtr = &realSrcStorage; |
} |
- this->drawBitmapRectToRect(bitmap, realSrcPtr, dst, paint); |
+ this->drawBitmapRectToRect(bitmap, realSrcPtr, dst, paint, flags); |
} |
virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, |
@@ -1071,7 +1083,8 @@ |
// canvas apis, without confusing subclasses (like SkPictureRecording) |
void internalDrawBitmap(const SkBitmap&, const SkMatrix& m, const SkPaint* paint); |
void internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
- const SkRect& dst, const SkPaint* paint); |
+ const SkRect& dst, const SkPaint* paint, |
+ DrawBitmapRectFlags flags); |
void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
const SkRect& dst, const SkPaint* paint); |
void internalDrawPaint(const SkPaint& paint); |