Add support for creating texture backed images where Skia will delete the texture.
Review URL: https://codereview.chromium.org/1187523005
diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp
index c195398..cfa6994 100644
--- a/src/gpu/GrTextureProvider.cpp
+++ b/src/gpu/GrTextureProvider.cpp
@@ -107,15 +107,17 @@
return NULL;
}
-GrTexture* GrTextureProvider::wrapBackendTexture(const GrBackendTextureDesc& desc) {
+GrTexture* GrTextureProvider::wrapBackendTexture(const GrBackendTextureDesc& desc,
+ GrWrapOwnership ownership) {
if (this->isAbandoned()) {
return NULL;
}
- return fGpu->wrapBackendTexture(desc);
+ return fGpu->wrapBackendTexture(desc, ownership);
}
GrRenderTarget* GrTextureProvider::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
- return this->isAbandoned() ? NULL : fGpu->wrapBackendRenderTarget(desc);
+ return this->isAbandoned() ? NULL : fGpu->wrapBackendRenderTarget(desc,
+ kBorrow_GrWrapOwnership);
}
void GrTextureProvider::assignUniqueKeyToResource(const GrUniqueKey& key, GrGpuResource* resource) {