aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-17 11:52:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-17 17:28:58 +0000
commit4493a9dc9df8cf306a974bde7e0e9c5470ebcdc9 (patch)
treecc6315711d78a8192d16ae4251b5bb683993b1fd /src/gpu/effects
parent4075ec80e1c36e414e57746c772298be3b49a74e (diff)
Continue making Ganesh use absolute texture coordinates
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix) Change-Id: Ibac3a540fcb1967ceef571157d41c1937acfadf8 Reviewed-on: https://skia-review.googlesource.com/6977 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/Gr1DKernelEffect.h2
-rw-r--r--src/gpu/effects/GrBicubicEffect.cpp3
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp2
-rw-r--r--src/gpu/effects/GrMatrixConvolutionEffect.cpp2
-rw-r--r--src/gpu/effects/GrYUVEffect.cpp23
5 files changed, 15 insertions, 17 deletions
diff --git a/src/gpu/effects/Gr1DKernelEffect.h b/src/gpu/effects/Gr1DKernelEffect.h
index d7402e8c45..29e0e5dec2 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)
- : INHERITED(texture, nullptr, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
+ : INHERITED(texture, nullptr, SkMatrix::I())
, fDirection(direction)
, fRadius(radius) {}
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 50a2a5d3e4..07d1c53011 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -181,8 +181,7 @@ sk_sp<GrFragmentProcessor> GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
static const SkShader::TileMode kClampClamp[] =
{ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode };
return GrBicubicEffect::Make(d->fTextures[texIdx], colorSpaceXform,
- GrCoordTransform::MakeDivByTextureWHMatrix(d->fTextures[texIdx]),
- kClampClamp);
+ SkMatrix::I(), kClampClamp);
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 8405fcbaf7..e6b3b28535 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -216,7 +216,7 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
*upmToPMRule = kConversionRules[i][1];
static const SkRect kDstRect = SkRect::MakeIWH(kSize, kSize);
- static const SkRect kSrcRect = SkRect::MakeIWH(1, 1);
+ static const SkRect kSrcRect = SkRect::MakeIWH(kSize, kSize);
// We do a PM->UPM draw from dataTex to readTex and read the data. Then we do a UPM->PM draw
// from readTex to tempTex followed by a PM->UPM draw to readTex and finally read the data.
// We then verify that two reads produced the same values.
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 8b98d0b32f..01fc6cec9c 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -156,7 +156,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
const SkIPoint& kernelOffset,
GrTextureDomain::Mode tileMode,
bool convolveAlpha)
- : INHERITED(texture, nullptr, GrCoordTransform::MakeDivByTextureWHMatrix(texture)),
+ : INHERITED(texture, nullptr, SkMatrix::I()),
fKernelSize(kernelSize),
fGain(SkScalarToFloat(gain)),
fBias(SkScalarToFloat(bias) / 255.0f),
diff --git a/src/gpu/effects/GrYUVEffect.cpp b/src/gpu/effects/GrYUVEffect.cpp
index 6d1fac2f32..41bab180ba 100644
--- a/src/gpu/effects/GrYUVEffect.cpp
+++ b/src/gpu/effects/GrYUVEffect.cpp
@@ -66,18 +66,17 @@ public:
GrTexture* vTexture, const SkISize sizes[3],
SkYUVColorSpace colorSpace, bool nv12) {
SkScalar w[3], h[3];
- w[0] = SkIntToScalar(sizes[0].fWidth) / SkIntToScalar(yTexture->width());
- h[0] = SkIntToScalar(sizes[0].fHeight) / SkIntToScalar(yTexture->height());
- w[1] = SkIntToScalar(sizes[1].fWidth) / SkIntToScalar(uTexture->width());
- h[1] = SkIntToScalar(sizes[1].fHeight) / SkIntToScalar(uTexture->height());
- w[2] = SkIntToScalar(sizes[2].fWidth) / SkIntToScalar(vTexture->width());
- h[2] = SkIntToScalar(sizes[2].fHeight) / SkIntToScalar(vTexture->height());
- SkMatrix yuvMatrix[3];
- yuvMatrix[0] = GrCoordTransform::MakeDivByTextureWHMatrix(yTexture);
- yuvMatrix[1] = yuvMatrix[0];
- yuvMatrix[1].preScale(w[1] / w[0], h[1] / h[0]);
- yuvMatrix[2] = yuvMatrix[0];
- yuvMatrix[2].preScale(w[2] / w[0], h[2] / h[0]);
+ w[0] = SkIntToScalar(sizes[0].fWidth);
+ h[0] = SkIntToScalar(sizes[0].fHeight);
+ w[1] = SkIntToScalar(sizes[1].fWidth);
+ h[1] = SkIntToScalar(sizes[1].fHeight);
+ w[2] = SkIntToScalar(sizes[2].fWidth);
+ h[2] = SkIntToScalar(sizes[2].fHeight);
+ const SkMatrix yuvMatrix[3] = {
+ SkMatrix::I(),
+ SkMatrix::MakeScale(w[1] / w[0], h[1] / h[0]),
+ SkMatrix::MakeScale(w[2] / w[0], h[2] / h[0])
+ };
GrSamplerParams::FilterMode uvFilterMode =
((sizes[1].fWidth != sizes[0].fWidth) ||
(sizes[1].fHeight != sizes[0].fHeight) ||