Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1496)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 40163004: Fix drawBitmap() of scratch texture. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix texture domain borders also; add GM Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 005da229c70d6671b9695b71529654ffbd4fb1f8..d80d0f511ef3e790f4527e0f009a3c15db61aafc 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 {
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698