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>
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index fcc5275..669f422 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -31,8 +31,8 @@
}
// 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 @@
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));
-}
-