aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-14 20:15:51 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-14 20:15:51 +0000
commit139a2359abdeedca1ff836aa24c1a6943d9274f8 (patch)
tree73f57f13187672b2f822d59846c494111ec08be4 /src/effects
parent7d4890c6f6b591313628433985f1f7d8c68fc46e (diff)
fix general-pespective for conical gradient bug=1744
BUG= R=edisonn@google.com Review URL: https://codereview.chromium.org/71303003 git-svn-id: http://skia.googlecode.com/svn/trunk@12299 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 2a822e4829..a9bd1c2762 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -236,16 +236,17 @@ void SkTwoPointConicalGradient::shadeSpan(int x, int y, SkPMColor* dstCParam,
fRec.setup(fx, fy, dx, dy);
(*shadeProc)(&fRec, dstC, cache, toggle, count);
} else { // perspective case
- SkScalar dstX = SkIntToScalar(x);
- SkScalar dstY = SkIntToScalar(y);
+ SkScalar dstX = SkIntToScalar(x) + SK_ScalarHalf;
+ SkScalar dstY = SkIntToScalar(y) + SK_ScalarHalf;
for (; count > 0; --count) {
SkPoint srcPt;
dstProc(fDstToIndex, dstX, dstY, &srcPt);
- dstX += SK_Scalar1;
-
fRec.setup(srcPt.fX, srcPt.fY, 0, 0);
(*shadeProc)(&fRec, dstC, cache, toggle, 1);
+
+ dstX += SK_Scalar1;
toggle = next_dither_toggle(toggle);
+ dstC += 1;
}
}
}