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>
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index 32042aa..0bebd8c 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -83,17 +83,16 @@
}
sk_sp<GrTexture> texture(
- GrRefCachedBitmapTexture(context, fBmp, GrSamplerParams::ClampNoFilter()));
+ GrRefCachedBitmapTexture(context, fBmp, GrSamplerParams::ClampNoFilter(), nullptr));
if (!texture) {
return;
}
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(),