aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp14
-rw-r--r--src/gpu/vk/GrVkGpu.cpp1
-rw-r--r--src/gpu/vk/GrVkTexture.cpp11
-rw-r--r--src/gpu/vk/GrVkTextureRenderTarget.cpp1
4 files changed, 8 insertions, 19 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 3924a5a84e..d7af9de287 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -520,7 +520,6 @@ sk_sp<GrTexture> GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
// next line relies on GrBackendTextureDesc's flags matching GrTexture's
bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag);
- SkASSERT(!renderTarget || kAdoptAndCache_GrWrapOwnership != ownership); // Not supported
GrGLTexture::IDDesc idDesc;
idDesc.fInfo = *info;
@@ -547,10 +546,10 @@ sk_sp<GrTexture> GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
return nullptr;
}
- if (kBorrow_GrWrapOwnership == ownership) {
- idDesc.fOwnership = GrBackendObjectOwnership::kBorrowed;
- } else {
+ if (kAdopt_GrWrapOwnership == ownership) {
idDesc.fOwnership = GrBackendObjectOwnership::kOwned;
+ } else {
+ idDesc.fOwnership = GrBackendObjectOwnership::kBorrowed;
}
GrSurfaceDesc surfDesc;
@@ -576,12 +575,7 @@ sk_sp<GrTexture> GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
}
return GrGLTextureRenderTarget::MakeWrapped(this, surfDesc, idDesc, rtIDDesc);
}
-
- if (kAdoptAndCache_GrWrapOwnership == ownership) {
- return sk_sp<GrTexture>(new GrGLTexture(this, SkBudgeted::kYes, surfDesc, idDesc));
- } else {
- return GrGLTexture::MakeWrapped(this, surfDesc, idDesc);
- }
+ return GrGLTexture::MakeWrapped(this, surfDesc, idDesc);
}
sk_sp<GrRenderTarget> GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc){
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 6412a55d0c..81fb089087 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -779,7 +779,6 @@ sk_sp<GrTexture> GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
surfDesc.fConfig = desc.fConfig;
surfDesc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount());
bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag);
- SkASSERT(!renderTarget || kAdoptAndCache_GrWrapOwnership != ownership); // Not supported
// In GL, Chrome assumes all textures are BottomLeft
// In VK, we don't have this restriction
surfDesc.fOrigin = resolve_origin(desc.fOrigin);
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index fb6b94fbc9..a8f1bf00dc 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -96,13 +96,10 @@ sk_sp<GrVkTexture> GrVkTexture::MakeWrappedTexture(GrVkGpu* gpu,
return nullptr;
}
- if (kAdoptAndCache_GrWrapOwnership == ownership) {
- return sk_sp<GrVkTexture>(new GrVkTexture(gpu, SkBudgeted::kYes, desc, *info, imageView));
- } else {
- GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership
- ? GrVkImage::kBorrowed_Wrapped : GrVkImage::kAdopted_Wrapped;
- return sk_sp<GrVkTexture>(new GrVkTexture(gpu, kWrapped, desc, *info, imageView, wrapped));
- }
+ GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImage::kBorrowed_Wrapped
+ : GrVkImage::kAdopted_Wrapped;
+
+ return sk_sp<GrVkTexture>(new GrVkTexture(gpu, kWrapped, desc, *info, imageView, wrapped));
}
GrVkTexture::~GrVkTexture() {
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp
index 1d7d75683f..cfa63be8af 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.cpp
+++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp
@@ -143,7 +143,6 @@ GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(GrVkGpu* gpu,
SkASSERT(info);
// Wrapped textures require both image and allocation (because they can be mapped)
SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc.fMemory);
- SkASSERT(kAdoptAndCache_GrWrapOwnership != ownership); // Not supported
GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImage::kBorrowed_Wrapped
: GrVkImage::kAdopted_Wrapped;