Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: include/core/SkCanvas.h

Issue 20806003: Plumb in "bleed" flag (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed pipe-specific issues and updated to ToT Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/bleed.cpp ('k') | include/core/SkDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « gm/bleed.cpp ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698