From 6df4d6be0d025211400de6a910e17f2a87219887 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 31 Aug 2017 15:57:32 +0000 Subject: Revert "Revert "Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget.""" This reverts commit 71554bc256b705fe959b7aa2fb2f24ed48782362. Reason for revert: Google3 Original change's description: > Revert "Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget."" > > This reverts commit 807371c15bd742efb98a9df6e1dee73e8bda8af5. > > Docs-Preview: https://skia.org/?cl=40260 > Change-Id: I28e0434c455155ff39a5aaa4141abdf442474e87 > Reviewed-on: https://skia-review.googlesource.com/40260 > Reviewed-by: Greg Daniel > Commit-Queue: Brian Salomon TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Ifdfa896a70db69935473276d12dce54de5c6b6f7 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/41500 Reviewed-by: Brian Salomon Commit-Queue: Brian Salomon --- src/image/SkSurface.cpp | 7 +++++++ src/image/SkSurface_Gpu.cpp | 14 ++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'src/image') diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp index 1de7b609e3..eba76be038 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -258,6 +258,13 @@ sk_sp SkSurface::MakeFromBackendTexture(GrContext*, const GrBackendTe return nullptr; } +sk_sp SkSurface::MakeFromBackendRenderTarget(GrContext*, + const GrBackendRenderTargetDesc&, + sk_sp, + const SkSurfaceProps*) { + return nullptr; +} + sk_sp SkSurface::MakeFromBackendRenderTarget(GrContext*, const GrBackendRenderTarget&, GrSurfaceOrigin origin, diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index 042fc32a67..a2bd40b3da 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -265,6 +265,20 @@ sk_sp SkSurface::MakeFromBackendTexture(GrContext* context, const GrB return sk_make_sp(std::move(device)); } +sk_sp SkSurface::MakeFromBackendRenderTarget(GrContext* context, + const GrBackendRenderTargetDesc& desc, + sk_sp colorSpace, + const SkSurfaceProps* props) { + if (!context) { + return nullptr; + } + + GrBackendRenderTarget backendRT(desc, context->contextPriv().getBackend()); + return MakeFromBackendRenderTarget(context, backendRT, desc.fOrigin, + std::move(colorSpace), props); + +} + sk_sp SkSurface::MakeFromBackendRenderTarget(GrContext* context, const GrBackendRenderTarget& backendRT, GrSurfaceOrigin origin, -- cgit v1.2.3