aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-08-29 15:05:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-29 15:05:53 -0700
commit6267f81f3d60ce144ab2b09ea369420984d5c9d9 (patch)
tree6735ee6442429168bd760eb3f12caa6131ab2bd7 /src
parent413191419dabdadf43625be2f6a5f0d4f2e3af4f (diff)
Move MakeDivByTextureWHMatrix to GrCoordTransform
R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/522873005
Diffstat (limited to 'src')
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp6
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp2
-rw-r--r--src/effects/SkLightingImageFilter.cpp2
-rw-r--r--src/effects/SkMagnifierImageFilter.cpp2
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp2
-rw-r--r--src/gpu/effects/Gr1DKernelEffect.h2
-rw-r--r--src/gpu/effects/GrBicubicEffect.h6
-rw-r--r--src/gpu/effects/GrMatrixConvolutionEffect.cpp2
-rw-r--r--src/gpu/effects/GrYUVtoRGBEffect.cpp3
9 files changed, 16 insertions, 11 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index 8022724ab2..ce35ba2baa 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -90,9 +90,11 @@ private:
float outerThreshold)
: fInnerThreshold(innerThreshold)
, fOuterThreshold(outerThreshold)
- , fImageCoordTransform(kLocal_GrCoordSet, MakeDivByTextureWHMatrix(texture), texture)
+ , fImageCoordTransform(kLocal_GrCoordSet,
+ GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture)
, fImageTextureAccess(texture)
- , fMaskCoordTransform(kLocal_GrCoordSet, MakeDivByTextureWHMatrix(maskTexture), maskTexture)
+ , fMaskCoordTransform(kLocal_GrCoordSet,
+ GrCoordTransform::MakeDivByTextureWHMatrix(maskTexture), maskTexture)
, fMaskTextureAccess(maskTexture) {
this->addCoordTransform(&fImageCoordTransform);
this->addTextureAccess(&fImageTextureAccess);
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 4054d5565a..5d15b4f8e8 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -427,7 +427,7 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
ctx.ctm().mapVectors(&scale, 1);
GrPaint paint;
- SkMatrix offsetMatrix = GrEffect::MakeDivByTextureWHMatrix(displacement);
+ SkMatrix offsetMatrix = GrCoordTransform::MakeDivByTextureWHMatrix(displacement);
offsetMatrix.preTranslate(SkIntToScalar(colorOffset.fX - displacementOffset.fX),
SkIntToScalar(colorOffset.fY - displacementOffset.fY));
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index bf2298c9d4..69e27609f6 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1272,7 +1272,7 @@ GrLightingEffect::GrLightingEffect(GrTexture* texture,
const SkLight* light,
SkScalar surfaceScale,
const SkMatrix& matrix)
- : INHERITED(texture, MakeDivByTextureWHMatrix(texture))
+ : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
, fLight(light)
, fSurfaceScale(surfaceScale)
, fFilterMatrix(matrix) {
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index bf6f4a7725..70e95f6e77 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -66,7 +66,7 @@ private:
float yInvZoom,
float xInvInset,
float yInvInset)
- : GrSingleTextureEffect(texture, MakeDivByTextureWHMatrix(texture))
+ : GrSingleTextureEffect(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
, fXOffset(xOffset)
, fYOffset(yOffset)
, fXInvZoom(xInvZoom)
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 88ea3f8a31..98936f71ed 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -154,7 +154,7 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
return false;
}
- SkMatrix foregroundMatrix = GrEffect::MakeDivByTextureWHMatrix(foregroundTex);
+ SkMatrix foregroundMatrix = GrCoordTransform::MakeDivByTextureWHMatrix(foregroundTex);
foregroundMatrix.preTranslate(SkIntToScalar(backgroundOffset.fX-foregroundOffset.fX),
SkIntToScalar(backgroundOffset.fY-foregroundOffset.fY));
diff --git a/src/gpu/effects/Gr1DKernelEffect.h b/src/gpu/effects/Gr1DKernelEffect.h
index 171273360b..a195b7606c 100644
--- a/src/gpu/effects/Gr1DKernelEffect.h
+++ b/src/gpu/effects/Gr1DKernelEffect.h
@@ -31,7 +31,7 @@ public:
Gr1DKernelEffect(GrTexture* texture,
Direction direction,
int radius)
- : GrSingleTextureEffect(texture, MakeDivByTextureWHMatrix(texture))
+ : GrSingleTextureEffect(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
, fDirection(direction)
, fRadius(radius) {}
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index 6cfb827415..27b111ed54 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -42,10 +42,12 @@ public:
if (NULL == domain) {
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode };
- return Create(tex, coefficients, MakeDivByTextureWHMatrix(tex), kTileModes);
+ return Create(tex, coefficients, GrCoordTransform::MakeDivByTextureWHMatrix(tex),
+ kTileModes);
} else {
return SkNEW_ARGS(GrBicubicEffect, (tex, coefficients,
- MakeDivByTextureWHMatrix(tex), *domain));
+ GrCoordTransform::MakeDivByTextureWHMatrix(tex),
+ *domain));
}
}
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index e573996e80..b78c6379c8 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -157,7 +157,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
const SkIPoint& kernelOffset,
GrTextureDomain::Mode tileMode,
bool convolveAlpha)
- : INHERITED(texture, MakeDivByTextureWHMatrix(texture)),
+ : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)),
fKernelSize(kernelSize),
fGain(SkScalarToFloat(gain)),
fBias(SkScalarToFloat(bias) / 255.0f),
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index 41d75c30ef..1a46c969ef 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -72,7 +72,8 @@ public:
private:
YUVtoRGBEffect(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vTexture)
- : fCoordTransform(kLocal_GrCoordSet, MakeDivByTextureWHMatrix(yTexture), yTexture)
+ : fCoordTransform(kLocal_GrCoordSet, GrCoordTransform::MakeDivByTextureWHMatrix(yTexture),
+ yTexture)
, fYAccess(yTexture)
, fUAccess(uTexture)
, fVAccess(vTexture) {