diff options
author | Greg Daniel <egdaniel@google.com> | 2018-02-21 11:36:53 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-21 17:13:32 +0000 |
commit | f87651e7b8c54569ace96ce9bf1671d5401eb91c (patch) | |
tree | 1e138bb9b90f4fd1f45855fb78506a5a465d8d8f /tests | |
parent | 2388866c8de62a9f9422125e2df40a8cf21727c6 (diff) |
Update createWrappedRenderTargetProxy with BackendTex to use lazy proxies
Bug: skia:
Change-Id: I5a5519aebe544cb5ef62e9847c3fa4e218f24aea
Reviewed-on: https://skia-review.googlesource.com/108561
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ProxyTest.cpp | 30 |
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; } |