diff options
author | 2017-01-25 12:10:37 -0500 | |
---|---|---|
committer | 2017-01-25 17:53:10 +0000 | |
commit | d46697ac36d5cb3b58571c6129cb5b26fe9d25d7 (patch) | |
tree | 5f7efe30049183c3248ce2cb8fe651e62f5c9392 /src | |
parent | 74b16edd98e4fd560baaf5655dd7e4ae43f8ae69 (diff) |
Use GrSurfaceContext::read/write-Pixels more
Change-Id: I04bcaf91aa7a43e0563e332c1fe2836d762a04d4
Reviewed-on: https://skia-review.googlesource.com/7520
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrContextPriv.h | 6 | ||||
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h index 3315c94e91..ed9691c656 100644 --- a/src/gpu/GrContextPriv.h +++ b/src/gpu/GrContextPriv.h @@ -35,6 +35,12 @@ public: SkBackingFit dstFit, SkBudgeted isDstBudgeted); + // TODO: add: + // sk_sp<GrSurfaceContext> makeBackendSurfaceContext(const GrBackendTextureDesc& desc, + // sk_sp<SkColorSpace> colorSpace, + // GrWrapOwnership = kBorrow_GrWrapOwnership); + // Maybe add a 'surfaceProps' param that is ignored for non-RTs? + sk_sp<GrRenderTargetContext> makeBackendTextureRenderTargetContext( const GrBackendTextureDesc& desc, sk_sp<SkColorSpace> colorSpace, diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 48fc401b4e..4cf4611f91 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -196,25 +196,20 @@ sk_sp<GrSurfaceProxy> GrSurfaceProxy::Copy(GrContext* context, return sk_ref_sp(dstContext->asDeferredSurface()); } -sk_sp<GrSurfaceProxy> GrSurfaceProxy::TestCopy(GrContext* context, const GrSurfaceDesc& dstDesc, - GrTexture* srcTexture, SkBudgeted budgeted) { +sk_sp<GrSurfaceContext> GrSurfaceProxy::TestCopy(GrContext* context, const GrSurfaceDesc& dstDesc, + GrSurfaceProxy* srcProxy) { sk_sp<GrSurfaceContext> dstContext(context->contextPriv().makeDeferredSurfaceContext( dstDesc, SkBackingFit::kExact, - budgeted)); + SkBudgeted::kYes)); if (!dstContext) { return nullptr; } - sk_sp<GrSurfaceProxy> srcProxy(GrSurfaceProxy::MakeWrapped(sk_ref_sp(srcTexture))); - if (!srcProxy) { + if (!dstContext->copy(srcProxy)) { return nullptr; } - if (!dstContext->copy(srcProxy.get())) { - return nullptr; - } - - return sk_ref_sp(dstContext->asDeferredSurface()); + return dstContext; } |