diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-09-22 20:24:05 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-09-22 20:24:05 +0000 |
commit | 6c59a17e1bcaa611ad9aee38d6f08b3a9e2ad8bf (patch) | |
tree | fee4951582f9615877030433419cd3c523e91e7e /src/effects | |
parent | 8e2af7eb8979ddd97bfd1615ccc173e66fe902d6 (diff) |
clear the kHasSpan16 bit for two-point-radial, since we don't implement that
fix perspective loop x (dstX)
git-svn-id: http://skia.googlecode.com/svn/trunk@364 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkGradientShader.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/effects/SkGradientShader.cpp b/src/effects/SkGradientShader.cpp index 502e9ccae7..a30de6a937 100644 --- a/src/effects/SkGradientShader.cpp +++ b/src/effects/SkGradientShader.cpp @@ -1296,9 +1296,11 @@ public: } else // perspective case { + SkScalar dstX = SkIntToScalar(x); + SkScalar dstY = SkIntToScalar(y); for (; count > 0; --count) { SkPoint srcPt; - dstProc(fDstToIndex, SkIntToScalar(x), SkIntToScalar(y), &srcPt); + dstProc(fDstToIndex, dstX, dstY, &srcPt); SkFixed fx = SkScalarToFixed(srcPt.fX); SkFixed fy = SkScalarToFixed(srcPt.fY); SkFixed b = (SkFixedMul(diffx, fx) + @@ -1307,11 +1309,23 @@ public: SkFixed index = proc(t); SkASSERT(index <= 0xFFFF); *dstC++ = cache[index >> (16 - kCache32Bits)]; - x += SK_Scalar1; + dstX += SK_Scalar1; } } } + virtual bool setContext(const SkBitmap& device, + const SkPaint& paint, + const SkMatrix& matrix) { + if (!this->INHERITED::setContext(device, paint, matrix)) { + return false; + } + + // we don't have a span16 proc + fFlags &= ~kHasSpan16_Flag; + return true; + } + static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { return SkNEW_ARGS(Two_Point_Radial_Gradient, (buffer)); } |