aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/SkSurface_Gpu.cpp')
-rw-r--r--src/image/SkSurface_Gpu.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 5001811cea..96ac31e16c 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -261,36 +261,19 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
if (!context) {
return nullptr;
}
-
- GrBackendRenderTarget backendRT(desc, context->contextPriv().getBackend());
- return MakeFromBackendRenderTarget(context, backendRT, desc.fOrigin,
- std::move(colorSpace), props);
-
-}
-
-sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
- const GrBackendRenderTarget& backendRT,
- GrSurfaceOrigin origin,
- sk_sp<SkColorSpace> colorSpace,
- const SkSurfaceProps* props) {
- if (!context) {
- return nullptr;
- }
- if (!SkSurface_Gpu::Valid(context, backendRT.config(), colorSpace.get())) {
+ if (!SkSurface_Gpu::Valid(context, desc.fConfig, colorSpace.get())) {
return nullptr;
}
sk_sp<GrRenderTargetContext> rtc(
- context->contextPriv().makeBackendRenderTargetRenderTargetContext(backendRT,
- origin,
+ context->contextPriv().makeBackendRenderTargetRenderTargetContext(desc,
std::move(colorSpace),
props));
if (!rtc) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(context, std::move(rtc),
- backendRT.width(), backendRT.height(),
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(context, std::move(rtc), desc.fWidth, desc.fHeight,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
@@ -299,6 +282,16 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
return sk_make_sp<SkSurface_Gpu>(std::move(device));
}
+sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext*,
+ const GrBackendRenderTarget&,
+ GrSurfaceOrigin origin,
+ sk_sp<SkColorSpace>,
+ const SkSurfaceProps*) {
+ // This function is not implemented yet
+ sk_throw();
+ return nullptr;
+}
+
sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* context,
const GrBackendTextureDesc& desc,
sk_sp<SkColorSpace> colorSpace,