Index: src/gpu/SkGpuDevice.cpp |
=================================================================== |
--- src/gpu/SkGpuDevice.cpp (revision 10408) |
+++ src/gpu/SkGpuDevice.cpp (working copy) |
@@ -1082,14 +1082,16 @@ |
const SkMatrix& m, |
const SkPaint& paint) { |
// We cannot call drawBitmapRect here since 'm' could be anything |
- this->drawBitmapCommon(draw, bitmap, NULL, m, paint); |
+ this->drawBitmapCommon(draw, bitmap, NULL, m, paint, |
+ SkCanvas::kNone_DrawBitmapRectflag); |
} |
void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, |
const SkBitmap& bitmap, |
const SkRect* srcRectPtr, |
const SkMatrix& m, |
- const SkPaint& paint) { |
+ const SkPaint& paint, |
+ SkCanvas::DrawBitmapRectFlags flags) { |
CHECK_SHOULD_DRAW(draw, false); |
SkRect srcRect; |
@@ -1100,6 +1102,8 @@ |
} |
if (paint.getMaskFilter()){ |
+ // TODO: this path needs to be updated to respect the bleed flag |
+ |
// Convert the bitmap to a shader so that the rect can be drawn |
// through drawRect, which supports mask filters. |
SkMatrix newM(m); |
@@ -1168,9 +1172,9 @@ |
if (!this->shouldTileBitmap(bitmap, params, srcRectPtr)) { |
// take the simple case |
- this->internalDrawBitmap(bitmap, srcRect, m, params, paint); |
+ this->internalDrawBitmap(bitmap, srcRect, m, params, paint, flags); |
} else { |
- this->drawTiledBitmap(bitmap, srcRect, m, params, paint); |
+ this->drawTiledBitmap(bitmap, srcRect, m, params, paint, flags); |
} |
} |
@@ -1180,7 +1184,9 @@ |
const SkRect& srcRect, |
const SkMatrix& m, |
const GrTextureParams& params, |
- const SkPaint& paint) { |
+ const SkPaint& paint, |
+ SkCanvas::DrawBitmapRectFlags flags) { |
+ // TODO: this method needs to be updated to respect the bleed flag |
const int maxTextureSize = fContext->getMaxTextureSize(); |
int tileSize = determine_tile_size(bitmap, srcRect, maxTextureSize); |
@@ -1229,7 +1235,7 @@ |
tmpM.preTranslate(SkIntToScalar(iTileR.fLeft), |
SkIntToScalar(iTileR.fTop)); |
- this->internalDrawBitmap(tmpB, tileR, tmpM, params, paint); |
+ this->internalDrawBitmap(tmpB, tileR, tmpM, params, paint, flags); |
} |
} |
} |
@@ -1288,7 +1294,8 @@ |
const SkRect& srcRect, |
const SkMatrix& m, |
const GrTextureParams& params, |
- const SkPaint& paint) { |
+ const SkPaint& paint, |
+ SkCanvas::DrawBitmapRectFlags flags) { |
SkASSERT(bitmap.width() <= fContext->getMaxTextureSize() && |
bitmap.height() <= fContext->getMaxTextureSize()); |
@@ -1308,7 +1315,8 @@ |
SkScalarMul(srcRect.fBottom, hInv)); |
bool needsTextureDomain = false; |
- if (params.filterMode() != GrTextureParams::kNone_FilterMode) { |
+ if (!(flags & SkCanvas::kBleed_DrawBitmapRectFlag) && |
+ params.filterMode() != GrTextureParams::kNone_FilterMode) { |
// Need texture domain if drawing a sub rect. |
needsTextureDomain = srcRect.width() < bitmap.width() || |
srcRect.height() < bitmap.height(); |
@@ -1438,7 +1446,8 @@ |
void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
const SkRect* src, const SkRect& dst, |
- const SkPaint& paint) { |
+ const SkPaint& paint, |
+ SkCanvas::DrawBitmapRectFlags flags) { |
SkMatrix matrix; |
SkRect bitmapBounds, tmpSrc; |
@@ -1463,7 +1472,7 @@ |
} |
} |
- this->drawBitmapCommon(draw, bitmap, &tmpSrc, matrix, paint); |
+ this->drawBitmapCommon(draw, bitmap, &tmpSrc, matrix, paint, flags); |
} |
void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device, |