aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProxyTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ProxyTest.cpp')
-rw-r--r--tests/ProxyTest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 3a46438e79..20d721be86 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -206,6 +206,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
}
// External on-screen render target.
+ // Tests createWrappedRenderTargetProxy with a GrBackendRenderTarget
{
GrGLFramebufferInfo fboInfo;
fboInfo.fFBOID = 0;
@@ -222,6 +223,32 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
supportedNumSamples, SkBackingFit::kExact, 0);
}
+ // Tests createWrappedRenderTargetProxy with a GrBackendTexture
+ {
+ GrBackendTexture backendTex =
+ gpu->createTestingOnlyBackendTexture(nullptr, kWidthHeight,
+ kWidthHeight, colorType, true,
+ GrMipMapped::kNo);
+ sk_sp<GrSurfaceProxy> sProxy =
+ proxyProvider->createWrappedRenderTargetProxy(backendTex, origin,
+ supportedNumSamples);
+ if (!sProxy) {
+ gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ continue; // This can fail on Mesa
+ }
+
+ check_surface(reporter, sProxy.get(), origin,
+ kWidthHeight, kWidthHeight,
+ backendTex.testingOnly_getPixelConfig(), SkBudgeted::kNo);
+ check_rendertarget(reporter, caps, resourceProvider,
+ sProxy->asRenderTargetProxy(),
+ supportedNumSamples, SkBackingFit::kExact,
+ caps.maxWindowRectangles());
+
+ gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ }
+
+ // Tests createWrappedTextureProxy that is only renderable
{
GrBackendTexture backendTex =
gpu->createTestingOnlyBackendTexture(nullptr, kWidthHeight,
@@ -232,6 +259,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
proxyProvider->createWrappedTextureProxy(backendTex, origin,
supportedNumSamples);
if (!sProxy) {
+ gpu->deleteTestingOnlyBackendTexture(&backendTex);
continue; // This can fail on Mesa
}
@@ -246,6 +274,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
gpu->deleteTestingOnlyBackendTexture(&backendTex);
}
+ // Tests createWrappedTextureProxy that is only textureable
{
// Internal offscreen texture
GrBackendTexture backendTex =
@@ -258,6 +287,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
kBorrow_GrWrapOwnership,
nullptr, nullptr);
if (!sProxy) {
+ gpu->deleteTestingOnlyBackendTexture(&backendTex);
continue;
}