Bug 688366 - Fix Skia marking radial gradients with the same radius as invalid. r=jrmuizel

This commit is contained in:
Matt Woodrow 2011-10-31 13:48:54 +13:00
parent 75646cdbb8
commit e17c07e1e6
3 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,25 @@
diff --git a/gfx/skia/src/effects/SkGradientShader.cpp b/gfx/skia/src/effects/SkGradientShader.cpp
--- a/gfx/skia/src/effects/SkGradientShader.cpp
+++ b/gfx/skia/src/effects/SkGradientShader.cpp
@@ -1652,17 +1652,20 @@ public:
}
return kRadial2_GradientType;
}
virtual void shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC, int count) {
SkASSERT(count > 0);
// Zero difference between radii: fill with transparent black.
- if (fDiffRadius == 0) {
+ // TODO: Is removing this actually correct? Two circles with the
+ // same radius, but different centers doesn't sound like it
+ // should be cleared
+ if (fDiffRadius == 0 && fCenter1 == fCenter2) {
sk_bzero(dstC, count * sizeof(*dstC));
return;
}
SkMatrix::MapXYProc dstProc = fDstToIndexProc;
TileProc proc = fTileProc;
const SkPMColor* SK_RESTRICT cache = this->getCache32();
SkScalar foura = fA * 4;

View File

@ -1657,7 +1657,10 @@ public:
SkASSERT(count > 0);
// Zero difference between radii: fill with transparent black.
if (fDiffRadius == 0) {
// TODO: Is removing this actually correct? Two circles with the
// same radius, but different centers doesn't sound like it
// should be cleared
if (fDiffRadius == 0 && fCenter1 == fCenter2) {
sk_bzero(dstC, count * sizeof(*dstC));
return;
}

View File

@ -101,3 +101,5 @@ patch -p3 < fix-gradient-clamp.patch
patch -p3 < getpostextpath.patch
# Bug 688365 - Enable Skia 'New AA' mode.
patch -p3 < new-aa.patch
# Bug 688366 - Fix Skia marking radial gradients with the same radius as invalid.
patch -p3 < radial-gradients.patch