diff options
author | Robert Phillips <robertphillips@google.com> | 2017-01-17 11:52:21 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-17 17:28:58 +0000 |
commit | 4493a9dc9df8cf306a974bde7e0e9c5470ebcdc9 (patch) | |
tree | cc6315711d78a8192d16ae4251b5bb683993b1fd /gm | |
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 'gm')
-rw-r--r-- | gm/texdata.cpp | 5 | ||||
-rw-r--r-- | gm/texturedomaineffect.cpp | 9 |
2 files changed, 5 insertions, 9 deletions
diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 8520d28b12..372ff5dc11 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -97,10 +97,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) { } else { vm.reset(); } - SkMatrix tm; - tm = vm; - tm.postIDiv(2*S, 2*S); - paint.addColorTextureProcessor(texture, nullptr, tm); + paint.addColorTextureProcessor(texture, nullptr, vm); renderTargetContext->drawRect(clip, GrPaint(paint), GrAA::kNo, vm, SkRect::MakeWH(2 * S, 2 * S)); diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index 32042aab84..cc3e1c9e3d 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -89,11 +89,10 @@ protected: } SkTArray<SkMatrix> textureMatrices; - textureMatrices.push_back().setIDiv(texture->width(), texture->height()); - textureMatrices.push_back() = textureMatrices[0]; - textureMatrices.back().postScale(1.5f, 0.85f); - textureMatrices.push_back() = textureMatrices[0]; - textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture->height() / 2.f); + textureMatrices.push_back() = SkMatrix::I(); + textureMatrices.push_back() = SkMatrix::MakeScale(1.5f, 0.85f); + textureMatrices.push_back(); + textureMatrices.back().setRotate(45.f, texture->width() / 2.f, texture->height() / 2.f); const SkIRect texelDomains[] = { fBmp.bounds(), |