aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-03-07 14:39:54 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-07 20:00:20 +0000
commit7578f3ecddf62853005782ea7414466d6a62db21 (patch)
tree87fca02e056baeaf7dd6a41d7328264cd0662a39 /src
parentaf4adefd8ccb46c148f7a16b54afc226b86c0fcc (diff)
Rename wrap backend tex/rt methods on GrProxyProvider
This makes them more consistent with similar methods on GrResourceProvider. Change-Id: Ice7e5dbe8100481781015b386445e9b7101bd75e Reviewed-on: https://skia-review.googlesource.com/112821 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrContext.cpp13
-rw-r--r--src/gpu/GrProxyProvider.cpp27
-rw-r--r--src/gpu/GrProxyProvider.h24
-rw-r--r--src/image/SkImage_Gpu.cpp12
4 files changed, 33 insertions, 43 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 16dfab35cd..611fe16377 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1241,7 +1241,7 @@ sk_sp<GrTextureContext> GrContextPriv::makeBackendTextureContext(const GrBackend
sk_sp<SkColorSpace> colorSpace) {
ASSERT_SINGLE_OWNER_PRIV
- sk_sp<GrSurfaceProxy> proxy = this->proxyProvider()->createWrappedTextureProxy(tex, origin);
+ sk_sp<GrSurfaceProxy> proxy = this->proxyProvider()->wrapBackendTexture(tex, origin);
if (!proxy) {
return nullptr;
}
@@ -1258,8 +1258,8 @@ sk_sp<GrRenderTargetContext> GrContextPriv::makeBackendTextureRenderTargetContex
ASSERT_SINGLE_OWNER_PRIV
SkASSERT(sampleCnt > 0);
- sk_sp<GrTextureProxy> proxy(this->proxyProvider()->createWrappedTextureProxy(tex, origin,
- sampleCnt));
+ sk_sp<GrTextureProxy> proxy(
+ this->proxyProvider()->wrapRenderableBackendTexture(tex, origin, sampleCnt));
if (!proxy) {
return nullptr;
}
@@ -1275,8 +1275,7 @@ sk_sp<GrRenderTargetContext> GrContextPriv::makeBackendRenderTargetRenderTargetC
const SkSurfaceProps* surfaceProps) {
ASSERT_SINGLE_OWNER_PRIV
- sk_sp<GrSurfaceProxy> proxy = this->proxyProvider()->createWrappedRenderTargetProxy(backendRT,
- origin);
+ sk_sp<GrSurfaceProxy> proxy = this->proxyProvider()->wrapBackendRenderTarget(backendRT, origin);
if (!proxy) {
return nullptr;
}
@@ -1294,8 +1293,8 @@ sk_sp<GrRenderTargetContext> GrContextPriv::makeBackendTextureAsRenderTargetRend
const SkSurfaceProps* props) {
ASSERT_SINGLE_OWNER_PRIV
SkASSERT(sampleCnt > 0);
- sk_sp<GrSurfaceProxy> proxy(this->proxyProvider()->createWrappedRenderTargetProxy(tex, origin,
- sampleCnt));
+ sk_sp<GrSurfaceProxy> proxy(
+ this->proxyProvider()->wrapBackendTextureAsRenderTarget(tex, origin, sampleCnt));
if (!proxy) {
return nullptr;
}
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 536cd137bd..5091228a60 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -399,12 +399,11 @@ sk_sp<GrTextureProxy> GrProxyProvider::createProxy(const GrSurfaceDesc& desc,
new GrTextureProxy(copyDesc, origin, mipMapped, fit, budgeted, flags));
}
-sk_sp<GrTextureProxy> GrProxyProvider::createWrappedTextureProxy(
- const GrBackendTexture& backendTex,
- GrSurfaceOrigin origin,
- GrWrapOwnership ownership,
- ReleaseProc releaseProc,
- ReleaseContext releaseCtx) {
+sk_sp<GrTextureProxy> GrProxyProvider::wrapBackendTexture(const GrBackendTexture& backendTex,
+ GrSurfaceOrigin origin,
+ GrWrapOwnership ownership,
+ ReleaseProc releaseProc,
+ ReleaseContext releaseCtx) {
if (this->isAbandoned()) {
return nullptr;
}
@@ -456,9 +455,8 @@ sk_sp<GrTextureProxy> GrProxyProvider::createWrappedTextureProxy(
return proxy;
}
-sk_sp<GrTextureProxy> GrProxyProvider::createWrappedTextureProxy(const GrBackendTexture& backendTex,
- GrSurfaceOrigin origin,
- int sampleCnt) {
+sk_sp<GrTextureProxy> GrProxyProvider::wrapRenderableBackendTexture(
+ const GrBackendTexture& backendTex, GrSurfaceOrigin origin, int sampleCnt) {
if (this->isAbandoned()) {
return nullptr;
}
@@ -513,9 +511,8 @@ sk_sp<GrTextureProxy> GrProxyProvider::createWrappedTextureProxy(const GrBackend
return proxy;
}
-sk_sp<GrSurfaceProxy> GrProxyProvider::createWrappedRenderTargetProxy(
- const GrBackendRenderTarget& backendRT,
- GrSurfaceOrigin origin) {
+sk_sp<GrSurfaceProxy> GrProxyProvider::wrapBackendRenderTarget(
+ const GrBackendRenderTarget& backendRT, GrSurfaceOrigin origin) {
if (this->isAbandoned()) {
return nullptr;
}
@@ -565,10 +562,8 @@ sk_sp<GrSurfaceProxy> GrProxyProvider::createWrappedRenderTargetProxy(
return proxy;
}
-sk_sp<GrSurfaceProxy> GrProxyProvider::createWrappedRenderTargetProxy(
- const GrBackendTexture& backendTex,
- GrSurfaceOrigin origin,
- int sampleCnt) {
+sk_sp<GrSurfaceProxy> GrProxyProvider::wrapBackendTextureAsRenderTarget(
+ const GrBackendTexture& backendTex, GrSurfaceOrigin origin, int sampleCnt) {
if (this->isAbandoned()) {
return nullptr;
}
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index 12ff10c005..0500e2f17c 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -120,30 +120,28 @@ public:
/*
* Create a texture proxy that wraps a (non-renderable) backend texture.
*/
- sk_sp<GrTextureProxy> createWrappedTextureProxy(const GrBackendTexture&, GrSurfaceOrigin,
- GrWrapOwnership = kBorrow_GrWrapOwnership,
- ReleaseProc = nullptr,
- ReleaseContext = nullptr);
+ sk_sp<GrTextureProxy> wrapBackendTexture(const GrBackendTexture&, GrSurfaceOrigin,
+ GrWrapOwnership = kBorrow_GrWrapOwnership,
+ ReleaseProc = nullptr, ReleaseContext = nullptr);
/*
* Create a texture proxy that wraps a backend texture and is both texture-able and renderable
*/
- sk_sp<GrTextureProxy> createWrappedTextureProxy(const GrBackendTexture&,
- GrSurfaceOrigin,
- int sampleCnt);
+ sk_sp<GrTextureProxy> wrapRenderableBackendTexture(const GrBackendTexture&,
+ GrSurfaceOrigin,
+ int sampleCnt);
/*
* Create a render target proxy that wraps a backend rendertarget
*/
- sk_sp<GrSurfaceProxy> createWrappedRenderTargetProxy(const GrBackendRenderTarget&,
- GrSurfaceOrigin);
+ sk_sp<GrSurfaceProxy> wrapBackendRenderTarget(const GrBackendRenderTarget&, GrSurfaceOrigin);
/*
- * Create a render target proxy that wraps a backend texture?
+ * Create a render target proxy that wraps a backend texture
*/
- sk_sp<GrSurfaceProxy> createWrappedRenderTargetProxy(const GrBackendTexture& tex,
- GrSurfaceOrigin origin,
- int sampleCnt);
+ sk_sp<GrSurfaceProxy> wrapBackendTextureAsRenderTarget(const GrBackendTexture& tex,
+ GrSurfaceOrigin origin,
+ int sampleCnt);
using LazyInstantiateCallback = std::function<sk_sp<GrSurface>(GrResourceProvider*)>;
enum class Textureable : bool {
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 86f89db813..6ed3e15bb2 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -305,8 +305,8 @@ static sk_sp<SkImage> new_wrapped_texture_common(GrContext* ctx,
}
GrProxyProvider* proxyProvider = ctx->contextPriv().proxyProvider();
- sk_sp<GrTextureProxy> proxy = proxyProvider->createWrappedTextureProxy(
- backendTex, origin, ownership, releaseProc, releaseCtx);
+ sk_sp<GrTextureProxy> proxy = proxyProvider->wrapBackendTexture(backendTex, origin, ownership,
+ releaseProc, releaseCtx);
if (!proxy) {
return nullptr;
}
@@ -422,16 +422,14 @@ static sk_sp<SkImage> make_from_yuv_textures_copy(GrContext* ctx, SkYUVColorSpac
return nullptr;
}
- sk_sp<GrTextureProxy> yProxy = proxyProvider->createWrappedTextureProxy(yuvBackendTextures[0],
- origin);
- sk_sp<GrTextureProxy> uProxy = proxyProvider->createWrappedTextureProxy(yuvBackendTextures[1],
- origin);
+ sk_sp<GrTextureProxy> yProxy = proxyProvider->wrapBackendTexture(yuvBackendTextures[0], origin);
+ sk_sp<GrTextureProxy> uProxy = proxyProvider->wrapBackendTexture(yuvBackendTextures[1], origin);
sk_sp<GrTextureProxy> vProxy;
if (nv12) {
vProxy = uProxy;
} else {
- vProxy = proxyProvider->createWrappedTextureProxy(yuvBackendTextures[2], origin);
+ vProxy = proxyProvider->wrapBackendTexture(yuvBackendTextures[2], origin);
}
if (!yProxy || !uProxy || !vProxy) {
return nullptr;