Index: src/pipe/SkGPipeWrite.cpp |
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp |
index 4dbb5b536c8f852a7116a5604ba40c1876b2579f..60a63b090a6f50b31f600a08a95e83f4570a6a2b 100644 |
--- a/src/pipe/SkGPipeWrite.cpp |
+++ b/src/pipe/SkGPipeWrite.cpp |
@@ -276,10 +276,10 @@ protected: |
void onDrawPath(const SkPath&, const SkPaint&) override; |
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override; |
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, |
- DrawBitmapRectFlags flags) override; |
+ SK_VIRTUAL_CONSTRAINT_TYPE) override; |
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override; |
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, |
- const SkPaint*) override; |
+ const SkPaint* SRC_RECT_CONSTRAINT_PARAM(constraint)) override; |
void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst, |
const SkPaint*) override; |
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, |
@@ -791,7 +791,10 @@ void SkGPipeCanvas::onDrawBitmap(const SkBitmap& bm, SkScalar left, SkScalar top |
} |
void SkGPipeCanvas::onDrawBitmapRect(const SkBitmap& bm, const SkRect* src, const SkRect& dst, |
- const SkPaint* paint, DrawBitmapRectFlags dbmrFlags) { |
+ const SkPaint* paint, |
+ SK_VIRTUAL_CONSTRAINT_TYPE legacyConstraint) { |
+ SrcRectConstraint constraint = (SrcRectConstraint)legacyConstraint; |
+ |
NOTIFY_SETUP(this); |
size_t opBytesNeeded = sizeof(SkRect); |
bool hasSrc = src != NULL; |
@@ -802,11 +805,11 @@ void SkGPipeCanvas::onDrawBitmapRect(const SkBitmap& bm, const SkRect* src, cons |
} else { |
flags = 0; |
} |
- if (dbmrFlags & kBleed_DrawBitmapRectFlag) { |
+ if (kFast_SrcRectConstraint == constraint) { |
flags |= kDrawBitmap_Bleed_DrawOpFlag; |
} |
- if (this->commonDrawBitmap(bm, kDrawBitmapRectToRect_DrawOp, flags, opBytesNeeded, paint)) { |
+ if (this->commonDrawBitmap(bm, kDrawBitmapRect_DrawOp, flags, opBytesNeeded, paint)) { |
if (hasSrc) { |
fWriter.writeRect(*src); |
} |
@@ -869,8 +872,10 @@ void SkGPipeCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, |
} |
void SkGPipeCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, |
- const SkPaint* paint) { |
+ const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { |
NOTIFY_SETUP(this); |
+ |
+ SRC_RECT_CONSTRAINT_LOCAL_DEFAULT(constraint) |
unsigned flags = 0; |
size_t opBytesNeeded = sizeof(SkRect); // dst |
if (src) { |
@@ -882,6 +887,7 @@ void SkGPipeCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, con |
fWriter.writeRect(*src); |
} |
fWriter.writeRect(dst); |
+ fWriter.writeInt(constraint); |
} |
} |