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

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

Issue 224083002: Add base effect for gpu 2pt conical gradients (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Patch merging Created 6 years, 9 months 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
Index: src/effects/gradients/SkTwoPointConicalGradient.cpp
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 74a581703c95030b1deb30808d36a6b6cca4a3df..de8c2364c364fe5f8081b4a2f91111575e38c6af 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -335,24 +335,8 @@ void SkTwoPointConicalGradient::flatten(
GrEffectRef* SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint&) const {
SkASSERT(NULL != context);
SkASSERT(fPtsToUnit.isIdentity());
- // invert the localM, translate to center1, rotate so center2 is on x axis.
- SkMatrix matrix;
- if (!this->getLocalMatrix().invert(&matrix)) {
- return NULL;
- }
- matrix.postTranslate(-fCenter1.fX, -fCenter1.fY);
-
- SkPoint diff = fCenter2 - fCenter1;
- SkScalar diffLen = diff.length();
- if (0 != diffLen) {
- SkScalar invDiffLen = SkScalarInvert(diffLen);
- SkMatrix rot;
- rot.setSinCos(-SkScalarMul(invDiffLen, diff.fY),
- SkScalarMul(invDiffLen, diff.fX));
- matrix.postConcat(rot);
- }
- return Gr2PtConicalGradientEffect::Create(context, *this, matrix, fTileMode);
+ return Gr2PtConicalGradientEffect::Create(context, *this, fTileMode);
}
#else
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698