aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-09 13:50:09 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-09 13:50:09 +0000
commitcb6d97ca718c0335dde678bb64169f6de70b62d6 (patch)
treea2363628642b4c6f9d965b4bf4b6831dea12a39c /src/effects/gradients
parent592dee99440059f6c79665e704165c355c99890d (diff)
Revert of r9902 (Consider conical shader opaque if it covers
entire plane - https://chromiumcodereview.appspot.com/18533006) due to roll issues (https://codereview.chromium.org/18859007/) git-svn-id: http://skia.googlecode.com/svn/trunk@9926 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp7
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.h1
2 files changed, 4 insertions, 4 deletions
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 7cb094391a..37b49f0d47 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -74,8 +74,6 @@ void TwoPtRadial::init(const SkPoint& center0, SkScalar rad0,
fA = sqr(fDCenterX) + sqr(fDCenterY) - sqr(fDRadius);
fRadius2 = sqr(fRadius);
fRDR = fRadius * fDRadius;
-
- fConeFillsPlane = rad0 != rad1 && SkMaxScalar(rad0, rad1) > SkPoint::Distance(center0, center1);
}
void TwoPtRadial::setup(SkScalar fx, SkScalar fy, SkScalar dfx, SkScalar dfy) {
@@ -191,7 +189,10 @@ SkTwoPointConicalGradient::SkTwoPointConicalGradient(
}
bool SkTwoPointConicalGradient::isOpaque() const {
- return INHERITED::isOpaque() && this->fRec.fConeFillsPlane;
+ // Because areas outside the cone are left untouched, we cannot treat the
+ // shader as opaque even if the gradient itself is opaque.
+ // TODO(junov): Compute whether the cone fills the plane crbug.com/222380
+ return false;
}
void SkTwoPointConicalGradient::shadeSpan(int x, int y, SkPMColor* dstCParam,
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h
index a78837077b..1358f0b2ac 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.h
+++ b/src/effects/gradients/SkTwoPointConicalGradient.h
@@ -23,7 +23,6 @@ struct TwoPtRadial {
float fA;
float fRadius2;
float fRDR;
- bool fConeFillsPlane;
void init(const SkPoint& center0, SkScalar rad0,
const SkPoint& center1, SkScalar rad1);