Switch ImageStorageAccess over to GrTextureProxies
Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))
Change-Id: I341de6ae121620d30e50bff21450878a18bdf4f2
Reviewed-on: https://skia-review.googlesource.com/16714
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tests/ImageStorageTest.cpp b/tests/ImageStorageTest.cpp
index dc4d212..aa81118 100644
--- a/tests/ImageStorageTest.cpp
+++ b/tests/ImageStorageTest.cpp
@@ -24,23 +24,19 @@
sk_sp<GrTextureProxy> proxy,
GrSLMemoryModel mm,
GrSLRestrict restrict) {
- // MDB TODO: remove this once ImageStorageAccess is converted to GrTextureProxy
- sk_sp<GrTexture> tex(sk_ref_sp(proxy->instantiate(resourceProvider)));
- if (!tex) {
- return nullptr;
- }
-
- return sk_sp<GrFragmentProcessor>(new TestFP(std::move(tex), mm, restrict));
+ return sk_sp<GrFragmentProcessor>(new TestFP(resourceProvider,
+ std::move(proxy), mm, restrict));
}
const char* name() const override { return "Image Load Test FP"; }
private:
- TestFP(sk_sp<GrTexture> texture, GrSLMemoryModel mm, GrSLRestrict restrict)
+ TestFP(GrResourceProvider* resourceProvider,
+ sk_sp<GrTextureProxy> proxy, GrSLMemoryModel mm, GrSLRestrict restrict)
: INHERITED(kNone_OptimizationFlags)
- , fImageStorageAccess(std::move(texture), kRead_GrIOType, mm, restrict) {
+ , fImageStorageAccess(std::move(proxy), kRead_GrIOType, mm, restrict) {
this->initClassID<TestFP>();
- this->addImageStorageAccess(&fImageStorageAccess);
+ this->addImageStorageAccess(resourceProvider, &fImageStorageAccess);
}
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}