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

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

Issue 278963002: add localmatrix parameter to shader's asNewEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « src/effects/gradients/SkRadialGradient.h ('k') | src/effects/gradients/SkSweepGradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkRadialGradient.cpp
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index e379f36c9577f33490e6ab9b0d86d34aa7835b2b..ce4c16a6543ec22b0eefdda1a99eb60f03165891 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -538,7 +538,7 @@ GrEffectRef* GrRadialGradient::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- return shader->asNewEffect(context, paint);
+ return shader->asNewEffect(context, paint, NULL);
}
/////////////////////////////////////////////////////////////////////
@@ -559,13 +559,21 @@ void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder,
/////////////////////////////////////////////////////////////////////
-GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&) const {
+GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&,
+ const SkMatrix* localMatrix) const {
SkASSERT(NULL != context);
SkMatrix matrix;
if (!this->getLocalMatrix().invert(&matrix)) {
return NULL;
}
+ if (localMatrix) {
+ SkMatrix inv;
+ if (!localMatrix->invert(&inv)) {
+ return NULL;
+ }
+ matrix.postConcat(inv);
+ }
matrix.postConcat(fPtsToUnit);
return GrRadialGradient::Create(context, *this, matrix, fTileMode);
}
« no previous file with comments | « src/effects/gradients/SkRadialGradient.h ('k') | src/effects/gradients/SkSweepGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698