diff options
author | 2013-10-24 15:59:31 +0000 | |
---|---|---|
committer | 2013-10-24 15:59:31 +0000 | |
commit | 34a849d00dcaea94e257501dac086bd34a9f0ae7 (patch) | |
tree | 8cfd0fa8bd31d1cfc2a876413fd02a42210577cf /src/gpu | |
parent | ad0e552fef861e47ca776c646556274c6abe191c (diff) |
Fix drawBitmap() of scratch texture.
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/40163004
git-svn-id: http://skia.googlecode.com/svn/trunk@11947 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 005da229c7..d80d0f511e 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1353,8 +1353,8 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, SkRect dstRect(srcRect); SkRect paintRect; - SkScalar wInv = SkScalarInvert(SkIntToScalar(bitmap.width())); - SkScalar hInv = SkScalarInvert(SkIntToScalar(bitmap.height())); + SkScalar wInv = SkScalarInvert(SkIntToScalar(texture->width())); + SkScalar hInv = SkScalarInvert(SkIntToScalar(texture->height())); paintRect.setLTRB(SkScalarMul(srcRect.fLeft, wInv), SkScalarMul(srcRect.fTop, hInv), SkScalarMul(srcRect.fRight, wInv), @@ -1388,14 +1388,14 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, // Use a constrained texture domain to avoid color bleeding SkScalar left, top, right, bottom; if (srcRect.width() > SK_Scalar1) { - SkScalar border = SK_ScalarHalf / bitmap.width(); + SkScalar border = SK_ScalarHalf / texture->width(); left = paintRect.left() + border; right = paintRect.right() - border; } else { left = right = SkScalarHalf(paintRect.left() + paintRect.right()); } if (srcRect.height() > SK_Scalar1) { - SkScalar border = SK_ScalarHalf / bitmap.height(); + SkScalar border = SK_ScalarHalf / texture->height(); top = paintRect.top() + border; bottom = paintRect.bottom() - border; } else { |