aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
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/image
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/image')
-rw-r--r--src/image/SkImageShader.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index 5b79fb1d9e..50cc3c4cd9 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -144,8 +144,6 @@ void SkImageShader::toString(SkString* str) const {
#include "effects/GrSimpleTextureEffect.h"
sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& args) const {
- SkMatrix matrix;
- matrix.setIDiv(fImage->width(), fImage->height());
SkMatrix lmInverse;
if (!this->getLocalMatrix().invert(&lmInverse)) {
@@ -158,7 +156,6 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& ar
}
lmInverse.postConcat(inv);
}
- matrix.preConcat(lmInverse);
SkShader::TileMode tm[] = { fTileModeX, fTileModeY };
@@ -182,10 +179,10 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& ar
args.fDstColorSpace);
sk_sp<GrFragmentProcessor> inner;
if (doBicubic) {
- inner = GrBicubicEffect::Make(texture.get(), std::move(colorSpaceXform), matrix, tm);
+ inner = GrBicubicEffect::Make(texture.get(), std::move(colorSpaceXform), lmInverse, tm);
} else {
inner = GrSimpleTextureEffect::Make(texture.get(), std::move(colorSpaceXform),
- matrix, params);
+ lmInverse, params);
}
if (GrPixelConfigIsAlphaOnly(texture->config())) {