diff options
author | 2017-01-20 12:44:06 -0500 | |
---|---|---|
committer | 2017-01-20 18:18:18 +0000 | |
commit | 67c18d6b5188a0497f6912a73d964c763d2f8f84 (patch) | |
tree | d32888c6b13589c2718fc6673f29acf2bb546c38 /src/effects/SkXfermodeImageFilter.cpp | |
parent | 41398f430dc501d450e04540a83b6aa5baf87cd7 (diff) |
Continue making Ganesh use absolute texture coordinates - take 2
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)
Relanding of: https://skia-review.googlesource.com/c/6977/
Change-Id: Ibc9b9e354f7fc23b1a6e6e4fe7c9fe3cef771c02
Reviewed-on: https://skia-review.googlesource.com/7265
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/effects/SkXfermodeImageFilter.cpp')
-rw-r--r-- | src/effects/SkXfermodeImageFilter.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 7f91df3ab5..c52eebadc6 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -249,10 +249,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU( sk_sp<GrFragmentProcessor> bgFP; if (backgroundTex) { - SkMatrix backgroundMatrix; - backgroundMatrix.setIDiv(backgroundTex->width(), backgroundTex->height()); - backgroundMatrix.preTranslate(-SkIntToScalar(backgroundOffset.fX), - -SkIntToScalar(backgroundOffset.fY)); + SkMatrix backgroundMatrix = SkMatrix::MakeTrans(-SkIntToScalar(backgroundOffset.fX), + -SkIntToScalar(backgroundOffset.fY)); sk_sp<GrColorSpaceXform> bgXform = GrColorSpaceXform::Make(background->getColorSpace(), outputProperties.colorSpace()); bgFP = GrTextureDomainEffect::Make( @@ -266,10 +264,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU( } if (foregroundTex) { - SkMatrix foregroundMatrix; - foregroundMatrix.setIDiv(foregroundTex->width(), foregroundTex->height()); - foregroundMatrix.preTranslate(-SkIntToScalar(foregroundOffset.fX), - -SkIntToScalar(foregroundOffset.fY)); + SkMatrix foregroundMatrix = SkMatrix::MakeTrans(-SkIntToScalar(foregroundOffset.fX), + -SkIntToScalar(foregroundOffset.fY)); sk_sp<GrColorSpaceXform> fgXform = GrColorSpaceXform::Make(foreground->getColorSpace(), outputProperties.colorSpace()); sk_sp<GrFragmentProcessor> foregroundFP; |