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

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient_gpu.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
Index: src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index 7986d82b961656f50428ee7493b3a1b57b1306c5..23fee850f5a3e4fda11937c00ce5ce9279b29d22 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -199,7 +199,7 @@ GrEffectRef* Edge2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- return shader->asNewEffect(context, paint);
+ return shader->asNewEffect(context, paint, NULL);
}
GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -470,7 +470,7 @@ GrEffectRef* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- return shader->asNewEffect(context, paint);
+ return shader->asNewEffect(context, paint, NULL);
}
GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -679,7 +679,7 @@ GrEffectRef* FocalInside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- return shader->asNewEffect(context, paint);
+ return shader->asNewEffect(context, paint, NULL);
}
GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -920,7 +920,7 @@ GrEffectRef* CircleInside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- return shader->asNewEffect(context, paint);
+ return shader->asNewEffect(context, paint, NULL);
}
GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -1148,7 +1148,7 @@ GrEffectRef* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- return shader->asNewEffect(context, paint);
+ return shader->asNewEffect(context, paint, NULL);
}
GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -1267,11 +1267,19 @@ GrGLEffect::EffectKey GLCircleOutside2PtConicalEffect::GenKey(const GrDrawEffect
GrEffectRef* Gr2PtConicalGradientEffect::Create(GrContext* ctx,
const SkTwoPointConicalGradient& shader,
- SkShader::TileMode tm) {
+ SkShader::TileMode tm,
+ const SkMatrix* localMatrix) {
SkMatrix matrix;
if (!shader.getLocalMatrix().invert(&matrix)) {
return NULL;
}
+ if (localMatrix) {
+ SkMatrix inv;
+ if (!localMatrix->invert(&inv)) {
+ return NULL;
+ }
+ matrix.postConcat(inv);
+ }
if (shader.getStartRadius() < kErrorTol) {
SkScalar focalX;
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient_gpu.h ('k') | src/effects/gradients/SkTwoPointRadialGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698