aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-22 20:29:16 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-22 20:29:16 +0000
commit1e3052354ac155e3d9418cf7e8c8e009df524e01 (patch)
treeb23d0a990add1c02dae46cdd9cc9dce786e96e21 /src
parent962f2d4e61176a10d35686b192ca4b3e373a8b08 (diff)
Fix bug in 1xN SkBitmapProcShader optimization
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapProcState.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index f16e855b55..d90fbf2fa0 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -455,7 +455,11 @@ static void S32_D32_constX_shaderproc(const SkBitmapProcState& s,
SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf,
&pt);
- yTemp = SkScalarFloorToInt(pt.fY);
+ // When the matrix has a scale component the setup code in
+ // chooseProcs multiples the inverse matrix by the inverse of the
+ // bitmap's width and height. Since this method is going to do
+ // its own tiling and sampling we need to undo that here.
+ yTemp = SkScalarFloorToInt(pt.fY * s.fBitmap->height());
} else {
yTemp = s.fFilterOneY + y;
}
@@ -481,6 +485,9 @@ static void S32_D32_constX_shaderproc(const SkBitmapProcState& s,
SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf,
&pt);
+ if (s.fInvType > SkMatrix::kTranslate_Mask) {
+ pt.fY *= s.fBitmap->height();
+ }
int iY2;
switch (s.fTileModeY) {