diff options
author | Robert Phillips <robertphillips@google.com> | 2017-12-13 15:00:45 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-13 21:34:20 +0000 |
commit | b67821da87ffa711c07af75ee618b13dbccd6b7d (patch) | |
tree | 25179bbe05f6104f0314458f4cdd52475dfed73e /tools | |
parent | 81d9f0d42eea5bb428808e0a48e4ef85aec45e10 (diff) |
Add GrBackendTexture & GrBackendRenderTarget access methods to GrTexture and GrRenderTarget
Change-Id: I627fcc2cab1d04169f49e33a6c17e161e9a9772a
Reviewed-on: https://skia-review.googlesource.com/84621
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/fiddle/fiddle_main.cpp | 28 | ||||
-rw-r--r-- | tools/gpu/GrTest.cpp | 22 | ||||
-rw-r--r-- | tools/gpu/GrTest.h | 5 |
3 files changed, 5 insertions, 50 deletions
diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp index 776e9d1dd4..4c7a0878a2 100644 --- a/tools/fiddle/fiddle_main.cpp +++ b/tools/fiddle/fiddle_main.cpp @@ -124,15 +124,12 @@ static bool setup_backend_objects(GrContext* context, return false; } - GrBackend backend = context->contextPriv().getBackend(); - const GrPixelConfig kConfig = kRGBA_8888_GrPixelConfig; - GrSurfaceDesc backingDesc; backingDesc.fFlags = kNone_GrSurfaceFlags; backingDesc.fOrigin = kTopLeft_GrSurfaceOrigin; backingDesc.fWidth = bm.width(); backingDesc.fHeight = bm.height(); - backingDesc.fConfig = kConfig; + backingDesc.fConfig = kRGBA_8888_GrPixelConfig; backingDesc.fSampleCnt = 0; if (!bm.empty()) { @@ -173,12 +170,7 @@ static bool setup_backend_objects(GrContext* context, return false; } - backEndTexture = GrTest::CreateBackendTexture(backend, - backingDesc.fWidth, - backingDesc.fHeight, - kConfig, - options.fMipMapping, - backingTexture->getTextureHandle()); + backEndTexture = backingTexture->getBackendTexture(); if (!backEndTexture.isValid()) { return false; } @@ -209,13 +201,7 @@ static bool setup_backend_objects(GrContext* context, backingRenderTarget = sk_ref_sp(tmp->asRenderTarget()); - backEndRenderTarget = GrTest::CreateBackendRenderTarget( - backend, - backingDesc.fWidth, - backingDesc.fHeight, - backingDesc.fSampleCnt, 0, - kConfig, - backingRenderTarget->getRenderTargetHandle()); + backEndRenderTarget = backingRenderTarget->getBackendRenderTarget(); if (!backEndRenderTarget.isValid()) { return false; } @@ -243,13 +229,7 @@ static bool setup_backend_objects(GrContext* context, return false; } - backEndTextureRenderTarget = GrTest::CreateBackendTexture( - backend, - backingDesc.fWidth, - backingDesc.fHeight, - kConfig, - options.fOffScreenMipMapping, - backingTextureRenderTarget->getTextureHandle()); + backEndTextureRenderTarget = backingTextureRenderTarget->getBackendTexture(); if (!backEndTextureRenderTarget.isValid()) { return false; } diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp index 0001d1dc27..552dd8a67e 100644 --- a/tools/gpu/GrTest.cpp +++ b/tools/gpu/GrTest.cpp @@ -78,28 +78,6 @@ GrBackendTexture CreateBackendTexture(GrBackend backend, int width, int height, } } -GrBackendRenderTarget CreateBackendRenderTarget(GrBackend backend, int width, int height, - int sampleCnt, int stencilBits, - GrPixelConfig config, - GrBackendObject handle) { - switch (backend) { -#ifdef SK_VULKAN - case kVulkan_GrBackend: { - GrVkImageInfo* vkInfo = (GrVkImageInfo*)(handle); - return GrBackendRenderTarget(width, height, sampleCnt, stencilBits, *vkInfo); - } -#endif - case kOpenGL_GrBackend: { - GrGLFramebufferInfo glInfo; - glInfo.fFBOID = handle; - return GrBackendRenderTarget(width, height, sampleCnt, stencilBits, config, glInfo); - } - case kMock_GrBackend: // fall through - default: - return GrBackendRenderTarget(); - } -} - } // namespace GrTest bool GrSurfaceProxy::isWrapped_ForTesting() const { diff --git a/tools/gpu/GrTest.h b/tools/gpu/GrTest.h index 1134932ad9..5d988c7b04 100644 --- a/tools/gpu/GrTest.h +++ b/tools/gpu/GrTest.h @@ -18,12 +18,9 @@ namespace GrTest { */ void SetupAlwaysEvictAtlas(GrContext*); + // TODO: remove this. It is only used in the SurfaceSemaphores Test. GrBackendTexture CreateBackendTexture(GrBackend, int width, int height, GrPixelConfig, GrMipMapped, GrBackendObject); - - GrBackendRenderTarget CreateBackendRenderTarget(GrBackend, int width, int height, - int sampleCnt, int stencilBits, - GrPixelConfig, GrBackendObject); }; #endif |