diff options
author | Robert Phillips <robertphillips@google.com> | 2016-11-09 06:50:43 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-09 12:20:50 +0000 |
commit | 3743013f755d23c215d852af7d829c3cd74f34a2 (patch) | |
tree | f685cc82d3dc40153863552b55c2519582c84d15 /src/gpu/GrRenderTargetProxy.cpp | |
parent | 7b8400dad2f82dcc6ed3c7cc1707ebaf85f04840 (diff) |
Consolidate GrSurfaceProxy Make methods
I think GrSurfaceDesc is still the most compact way to communicate the deferred GrSurface's settings to the Proxy but this CL, at least, reduces where it is used.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4559
Change-Id: Ica599c28a5aef1ed4094f47a4ac119e2d204d652
Reviewed-on: https://skia-review.googlesource.com/4559
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetProxy.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetProxy.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp index fcc5275002..669f422371 100644 --- a/src/gpu/GrRenderTargetProxy.cpp +++ b/src/gpu/GrRenderTargetProxy.cpp @@ -31,8 +31,8 @@ GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrSurfaceDesc } // Wrapped version -GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrRenderTarget> rt) - : INHERITED(std::move(rt), SkBackingFit::kExact) +GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrSurface> surf) + : INHERITED(std::move(surf), SkBackingFit::kExact) , fFlags(fTarget->asRenderTarget()->renderTargetPriv().flags()) { } @@ -70,21 +70,3 @@ size_t GrRenderTargetProxy::onGpuMemorySize() const { return GrSurface::ComputeSize(fDesc, fDesc.fSampleCnt+1, false); } -sk_sp<GrRenderTargetProxy> GrRenderTargetProxy::Make(const GrCaps& caps, - const GrSurfaceDesc& desc, - SkBackingFit fit, - SkBudgeted budgeted) { - // We know anything we instantiate later from this deferred path will be - // both texturable and renderable - return GrTextureRenderTargetProxy::Make(caps, desc, fit, budgeted); -} - -sk_sp<GrRenderTargetProxy> GrRenderTargetProxy::Make(sk_sp<GrRenderTarget> rt) { - if (rt->asTexture()) { - return GrTextureRenderTargetProxy::Make(std::move(rt)); - } - - // Not texturable - return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(rt)); -} - |