Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient.cpp

Issue 793763003: Gradient shaders: make fPtsToUnit const, pre-cache getType(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | src/effects/gradients/SkTwoPointRadialGradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkTwoPointConicalGradient.cpp
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 2fc848e10962a86a4bd7dbd2a7644b9308306f4a..94751a89c63a30c3cf8373ecc2af307557075879 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -186,18 +186,13 @@ static void twopoint_mirror(TwoPtRadialContext* rec, SkPMColor* SK_RESTRICT dstC
}
}
-void SkTwoPointConicalGradient::init() {
- fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad);
- fPtsToUnit.reset();
-}
-
/////////////////////////////////////////////////////////////////////
SkTwoPointConicalGradient::SkTwoPointConicalGradient(
const SkPoint& start, SkScalar startRadius,
const SkPoint& end, SkScalar endRadius,
bool flippedGrad, const Descriptor& desc)
- : SkGradientShaderBase(desc)
+ : SkGradientShaderBase(desc, SkMatrix::I())
, fCenter1(start)
, fCenter2(end)
, fRadius1(startRadius)
@@ -206,7 +201,7 @@ SkTwoPointConicalGradient::SkTwoPointConicalGradient(
{
// this is degenerate, and should be caught by our caller
SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2);
- this->init();
+ fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad);
}
bool SkTwoPointConicalGradient::isOpaque() const {
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | src/effects/gradients/SkTwoPointRadialGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698