Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 063509a5a4d6b3d4e27a81f7a852d7c140030a40..062ef54505fbef52f88d549087bc62889ddfa3f2 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -1117,26 +1117,23 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, |
SkBitmap tmp; // subset of bitmap, if necessary |
const SkBitmap* bitmapPtr = &bitmap; |
if (NULL != srcRectPtr) { |
robertphillips
2013/11/22 18:59:37
Maybe: "In bleed mode we position the bitmap based
|
- SkIRect iSrc; |
- srcRect.roundOut(&iSrc); |
+ // In bleed mode we simply want to position the bitmap based on the src rect. Matrix m |
+ // and srcRect already accounts for this. |
+ if (!(SkCanvas::kBleed_DrawBitmapRectFlag & flags)) { |
+ SkIRect iSrc; |
+ srcRect.roundOut(&iSrc); |
- SkPoint offset = SkPoint::Make(SkIntToScalar(iSrc.fLeft), |
- SkIntToScalar(iSrc.fTop)); |
+ SkPoint offset = SkPoint::Make(SkIntToScalar(iSrc.fLeft), |
+ SkIntToScalar(iSrc.fTop)); |
- if (SkCanvas::kBleed_DrawBitmapRectFlag & flags) { |
- // In bleed mode we want to expand the src rect on all sides |
- // but stay within the bitmap bounds |
- SkIRect iClampRect = SkIRect::MakeWH(bitmap.width(), bitmap.height()); |
- clamped_unit_outset_with_offset(&iSrc, &offset, iClampRect); |
- } |
- |
- if (!bitmap.extractSubset(&tmp, iSrc)) { |
- return; // extraction failed |
+ if (!bitmap.extractSubset(&tmp, iSrc)) { |
+ return; // extraction failed |
+ } |
+ bitmapPtr = &tmp; |
+ srcRect.offset(-offset.fX, -offset.fY); |
+ // The source rect has changed so update the matrix |
+ newM.preTranslate(offset.fX, offset.fY); |
} |
- bitmapPtr = &tmp; |
- srcRect.offset(-offset.fX, -offset.fY); |
- // The source rect has changed so update the matrix |
- newM.preTranslate(offset.fX, offset.fY); |
} |
SkPaint paintWithTexture(paint); |