diff options
author | 2017-01-17 11:52:21 -0500 | |
---|---|---|
committer | 2017-01-17 17:28:58 +0000 | |
commit | 4493a9dc9df8cf306a974bde7e0e9c5470ebcdc9 (patch) | |
tree | cc6315711d78a8192d16ae4251b5bb683993b1fd /src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp | |
parent | 4075ec80e1c36e414e57746c772298be3b49a74e (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/glsl/GrGLSLPrimitiveProcessor.cpp')
-rw-r--r-- | src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp index 24f21ffe7a..f39fff2a07 100644 --- a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp +++ b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp @@ -16,6 +16,11 @@ SkMatrix GrGLSLPrimitiveProcessor::GetTransformMatrix(const SkMatrix& localMatri const GrCoordTransform& coordTransform) { SkMatrix combined; combined.setConcat(coordTransform.getMatrix(), localMatrix); + if (coordTransform.normalize()) { + SkASSERT(coordTransform.texture()); + combined.postIDiv(coordTransform.texture()->width(), coordTransform.texture()->height()); + } + if (coordTransform.reverseY()) { // combined.postScale(1,-1); // combined.postTranslate(0,1); |