aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-30 13:27:37 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-30 19:05:36 +0000
commitf200a90f3e58ce20753420cadced850d7d00dca1 (patch)
treed4618a39bdd6f74b070b236283819ae7f4770d33 /include
parentefe3dedbb3493b738abdb56041b093245e4e8711 (diff)
Rationalize GrContext's Gr*Proxy getter naming
This CL replaces the entry points: asDeferredSurface asDeferredTexture asDeferredRenderTarget with: GrSurfaceProxy* asSurfaceProxy sk_sp<GrSurfaceProxy> asSurfaceProxyRef GrTextureProxy* asTextureProxy sk_sp<GrTextureProxy> asTextureProxyRef GrRenderTargetProxy* asRenderTargetProxy sk_sp<GrRenderTargetProxy> asRenderTargetProxyRef Change-Id: I7c2b1ea3d702023ff23019815ca13c9ff6f3b32d Reviewed-on: https://skia-review.googlesource.com/7741 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrRenderTargetContext.h15
-rw-r--r--include/gpu/GrSurfaceContext.h17
-rw-r--r--include/gpu/GrTextureContext.h13
3 files changed, 30 insertions, 15 deletions
diff --git a/include/gpu/GrRenderTargetContext.h b/include/gpu/GrRenderTargetContext.h
index 040e896b71..403de56f34 100644
--- a/include/gpu/GrRenderTargetContext.h
+++ b/include/gpu/GrRenderTargetContext.h
@@ -348,10 +348,15 @@ public:
return fRenderTargetProxy->instantiate(fContext->textureProvider());
}
- GrSurfaceProxy* asDeferredSurface() override { return fRenderTargetProxy.get(); }
- const GrSurfaceProxy* asDeferredSurface() const override { return fRenderTargetProxy.get(); }
- GrTextureProxy* asDeferredTexture() override;
- GrRenderTargetProxy* asDeferredRenderTarget() override { return fRenderTargetProxy.get(); }
+ GrSurfaceProxy* asSurfaceProxy() override { return fRenderTargetProxy.get(); }
+ const GrSurfaceProxy* asSurfaceProxy() const override { return fRenderTargetProxy.get(); }
+ sk_sp<GrSurfaceProxy> asSurfaceProxyRef() override { return fRenderTargetProxy; }
+
+ GrTextureProxy* asTextureProxy() override;
+ sk_sp<GrTextureProxy> asTextureProxyRef() override;
+
+ GrRenderTargetProxy* asRenderTargetProxy() override { return fRenderTargetProxy.get(); }
+ sk_sp<GrRenderTargetProxy> asRenderTargetProxyRef() override { return fRenderTargetProxy; }
GrRenderTargetContext* asRenderTargetContext() override { return this; }
@@ -362,7 +367,7 @@ public:
// TODO: usage of this entry point needs to be reduced and potentially eliminated
// since it ends the deferral of the GrRenderTarget's allocation
- // It's usage should migrate to asDeferredTexture
+ // It's usage should migrate to asTextureProxyRef
return sk_ref_sp(this->accessRenderTarget()->asTexture());
}
diff --git a/include/gpu/GrSurfaceContext.h b/include/gpu/GrSurfaceContext.h
index 43d6a10b62..8be63aba68 100644
--- a/include/gpu/GrSurfaceContext.h
+++ b/include/gpu/GrSurfaceContext.h
@@ -37,8 +37,8 @@ public:
bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); }
// TODO: these two calls would be way cooler if this object had a GrSurfaceProxy pointer
- int width() const { return this->asDeferredSurface()->width(); }
- int height() const { return this->asDeferredSurface()->height(); }
+ int width() const { return this->asSurfaceProxy()->width(); }
+ int height() const { return this->asSurfaceProxy()->height(); }
/*
* Copy 'src' into the proxy backing this context
@@ -96,10 +96,15 @@ public:
}
// TODO: this is virtual b.c. this object doesn't have a pointer to the wrapped GrSurfaceProxy?
- virtual GrSurfaceProxy* asDeferredSurface() = 0;
- virtual const GrSurfaceProxy* asDeferredSurface() const = 0;
- virtual GrTextureProxy* asDeferredTexture() = 0;
- virtual GrRenderTargetProxy* asDeferredRenderTarget() = 0;
+ virtual GrSurfaceProxy* asSurfaceProxy() = 0;
+ virtual const GrSurfaceProxy* asSurfaceProxy() const = 0;
+ virtual sk_sp<GrSurfaceProxy> asSurfaceProxyRef() = 0;
+
+ virtual GrTextureProxy* asTextureProxy() = 0;
+ virtual sk_sp<GrTextureProxy> asTextureProxyRef() = 0;
+
+ virtual GrRenderTargetProxy* asRenderTargetProxy() = 0;
+ virtual sk_sp<GrRenderTargetProxy> asRenderTargetProxyRef() = 0;
virtual GrRenderTargetContext* asRenderTargetContext() { return nullptr; }
diff --git a/include/gpu/GrTextureContext.h b/include/gpu/GrTextureContext.h
index 2ec8b4b78f..48a2e4842d 100644
--- a/include/gpu/GrTextureContext.h
+++ b/include/gpu/GrTextureContext.h
@@ -27,10 +27,15 @@ class SK_API GrTextureContext : public GrSurfaceContext {
public:
~GrTextureContext() override;
- GrSurfaceProxy* asDeferredSurface() override { return fTextureProxy.get(); }
- const GrSurfaceProxy* asDeferredSurface() const override { return fTextureProxy.get(); }
- GrTextureProxy* asDeferredTexture() override { return fTextureProxy.get(); }
- GrRenderTargetProxy* asDeferredRenderTarget() override;
+ GrSurfaceProxy* asSurfaceProxy() override { return fTextureProxy.get(); }
+ const GrSurfaceProxy* asSurfaceProxy() const override { return fTextureProxy.get(); }
+ sk_sp<GrSurfaceProxy> asSurfaceProxyRef() override { return fTextureProxy; }
+
+ GrTextureProxy* asTextureProxy() override { return fTextureProxy.get(); }
+ sk_sp<GrTextureProxy> asTextureProxyRef() override { return fTextureProxy; }
+
+ GrRenderTargetProxy* asRenderTargetProxy() override;
+ sk_sp<GrRenderTargetProxy> asRenderTargetProxyRef() override;
protected:
GrTextureContext(GrContext*, GrDrawingManager*, sk_sp<GrTextureProxy>,