Reduce dependence on GrSurface's origin field (take 3)
TBR=bsalomon@google.com
Change-Id: I8c95c6774897dbd87e3c5c87d92f75c5b64d4e76
Reviewed-on: https://skia-review.googlesource.com/26424
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index d67f103..f1d6a26 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -184,7 +184,7 @@
if (!tex) {
continue;
}
- auto proxy = GrSurfaceProxy::MakeWrapped(std::move(tex));
+ auto proxy = GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
auto texCtx = context->contextPriv().makeWrappedSurfaceContext(
std::move(proxy), nullptr);
SkImageInfo info = SkImageInfo::Make(
diff --git a/tests/ProxyConversionTest.cpp b/tests/ProxyConversionTest.cpp
index 513b680..23ca695 100644
--- a/tests/ProxyConversionTest.cpp
+++ b/tests/ProxyConversionTest.cpp
@@ -29,7 +29,7 @@
sk_sp<GrRenderTarget> defaultFBO(provider->wrapBackendRenderTarget(backendRT, desc.fOrigin));
SkASSERT(!defaultFBO->asTexture());
- return GrSurfaceProxy::MakeWrapped(std::move(defaultFBO));
+ return GrSurfaceProxy::MakeWrapped(std::move(defaultFBO), desc.fOrigin);
}
static sk_sp<GrSurfaceProxy> make_wrapped_offscreen_rt(GrResourceProvider* provider,
@@ -40,7 +40,7 @@
sk_sp<GrTexture> tex(provider->createTexture(desc, budgeted));
- return GrSurfaceProxy::MakeWrapped(std::move(tex));
+ return GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
}
static sk_sp<GrSurfaceProxy> make_wrapped_texture(GrResourceProvider* provider,
@@ -48,7 +48,7 @@
SkBudgeted budgeted) {
sk_sp<GrTexture> tex(provider->createTexture(desc, budgeted));
- return GrSurfaceProxy::MakeWrapped(std::move(tex));
+ return GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
}
// Test converting between RenderTargetProxies and TextureProxies for wrapped
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index a30766b..3648122 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -87,7 +87,7 @@
sk_sp<GrTexture> tex(context->resourceProvider()->createTexture(desc, SkBudgeted::kNo));
- return GrSurfaceProxy::MakeWrapped(std::move(tex));
+ return GrSurfaceProxy::MakeWrapped(std::move(tex), desc.fOrigin);
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProxyRefTest, reporter, ctxInfo) {
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index dd1f4cb..547d3b2 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -236,7 +236,8 @@
sk_sp<GrRenderTarget> defaultFBO(
provider->wrapBackendRenderTarget(backendRT, origin));
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(defaultFBO));
+ sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(defaultFBO,
+ origin));
check_surface(reporter, sProxy.get(), origin,
kWidthHeight, kWidthHeight, config,
defaultFBO->uniqueID(), SkBudgeted::kNo);
@@ -252,7 +253,7 @@
tex = provider->createTexture(desc, budgeted);
sk_sp<GrRenderTarget> rt(sk_ref_sp(tex->asRenderTarget()));
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(rt));
+ sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(rt, origin));
check_surface(reporter, sProxy.get(), origin,
kWidthHeight, kWidthHeight, config,
rt->uniqueID(), budgeted);
@@ -267,7 +268,7 @@
tex = provider->createTexture(desc, budgeted);
}
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(tex));
+ sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(tex, origin));
check_surface(reporter, sProxy.get(), origin,
kWidthHeight, kWidthHeight, config, tex->uniqueID(), budgeted);
check_texture(reporter, provider, sProxy->asTextureProxy(),
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index 96db1f7..4aa055d 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -56,7 +56,7 @@
sk_sp<GrSurface> tex = context->resourceProvider()->wrapBackendTexture(
backendTex, p.fOrigin,
kBorrow_GrWrapOwnership);
- return GrSurfaceProxy::MakeWrapped(std::move(tex));
+ return GrSurfaceProxy::MakeWrapped(std::move(tex), p.fOrigin);
}
static void cleanup_backend(GrContext* context, GrBackendObject* backendTexHandle) {