Chromium Code Reviews| Index: src/gpu/SkGpuDevice.cpp |
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
| index 063509a5a4d6b3d4e27a81f7a852d7c140030a40..1b4f71af0f088447c203a947d8e1fa45b199c855 100644 |
| --- a/src/gpu/SkGpuDevice.cpp |
| +++ b/src/gpu/SkGpuDevice.cpp |
| @@ -1116,27 +1116,27 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, |
| SkMatrix newM(m); |
| SkBitmap tmp; // subset of bitmap, if necessary |
| const SkBitmap* bitmapPtr = &bitmap; |
| + SkMatrix localM; |
| + localM.reset(); |
|
reed1
2013/11/22 16:23:29
Where is localM referenced after it is set?
bsalomon
2013/11/22 16:36:56
woah, you're right. I picked up this change after
|
| if (NULL != srcRectPtr) { |
| - SkIRect iSrc; |
| - srcRect.roundOut(&iSrc); |
| - |
| - 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); |
| - } |
| + // In bleed mode we simply want to position the bitmap based on the src rect |
| + localM.setTranslate(srcRect.fLeft, srcRect.fTop); |
| + } else { |
| + SkIRect iSrc; |
| + srcRect.roundOut(&iSrc); |
| + |
| + SkPoint offset = SkPoint::Make(SkIntToScalar(iSrc.fLeft), |
| + SkIntToScalar(iSrc.fTop)); |
| - 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); |