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

Unified Diff: src/effects/SkPerlinNoiseShader.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/core/SkShader.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index c6d61180029b30d1e28065e46a283387032acf7d..101537798e6842a795d7f6c932491de3df0aab96 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -723,7 +723,7 @@ GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
stitchTiles ? &tileSize : NULL);
SkPaint paint;
- GrEffectRef* effect = shader->asNewEffect(context, paint);
+ GrEffectRef* effect = shader->asNewEffect(context, paint, NULL);
SkDELETE(shader);
@@ -1275,9 +1275,15 @@ void GrGLSimplexNoise::setData(const GrGLUniformManager& uman, const GrDrawEffec
/////////////////////////////////////////////////////////////////////
-GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint) const {
+GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
+ const SkMatrix* externalLocalMatrix) const {
SkASSERT(NULL != context);
+ SkMatrix localMatrix = this->getLocalMatrix();
+ if (externalLocalMatrix) {
+ localMatrix.preConcat(*externalLocalMatrix);
+ }
+
if (0 == fNumOctaves) {
SkColor clearColor = 0;
if (kFractalNoise_Type == fType) {
@@ -1309,7 +1315,7 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint&
fNumOctaves, fStitchTiles,
fPaintingData->fStitchDataInit,
permutationsTexture, noiseTexture,
- this->getLocalMatrix(), paint.getAlpha()) :
+ localMatrix, paint.getAlpha()) :
NULL;
// Unlock immediately, this is not great, but we don't have a way of
@@ -1328,7 +1334,7 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint&
#else
-GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext*, const SkPaint&) const {
+GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext*, const SkPaint&, const SkMatrix*) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return NULL;
}
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698