Index: src/gpu/vk/GrVkGpu.cpp |
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp |
index 1ce78fd192a27d5899b6f8ab671f64f533005fc0..ff6cb41e5b5bbac3a9eb10baba9706e02eeb2e2e 100644 |
--- a/src/gpu/vk/GrVkGpu.cpp |
+++ b/src/gpu/vk/GrVkGpu.cpp |
@@ -583,15 +583,9 @@ GrTexture* GrVkGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc, |
// TODO: determine what format Chrome will actually send us and turn it into a Resource |
GrVkImage::Resource* imageRsrc = reinterpret_cast<GrVkImage::Resource*>(desc.fTextureHandle); |
- GrGpuResource::LifeCycle lifeCycle; |
- switch (ownership) { |
- case kAdopt_GrWrapOwnership: |
- lifeCycle = GrGpuResource::kAdopted_LifeCycle; |
- break; |
- case kBorrow_GrWrapOwnership: |
- lifeCycle = GrGpuResource::kBorrowed_LifeCycle; |
- break; |
- } |
+ GrGpuResource::LifeCycle lifeCycle = (kAdopt_GrWrapOwnership == ownership) |
+ ? GrGpuResource::kAdopted_LifeCycle |
+ : GrGpuResource::kBorrowed_LifeCycle; |
GrSurfaceDesc surfDesc; |
// next line relies on GrBackendTextureDesc's flags matching GrTexture's |
@@ -627,15 +621,9 @@ GrRenderTarget* GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe |
GrVkImage::Resource* imageRsrc = |
reinterpret_cast<GrVkImage::Resource*>(wrapDesc.fRenderTargetHandle); |
- GrGpuResource::LifeCycle lifeCycle; |
- switch (ownership) { |
- case kAdopt_GrWrapOwnership: |
- lifeCycle = GrGpuResource::kAdopted_LifeCycle; |
- break; |
- case kBorrow_GrWrapOwnership: |
- lifeCycle = GrGpuResource::kBorrowed_LifeCycle; |
- break; |
- } |
+ GrGpuResource::LifeCycle lifeCycle = (kAdopt_GrWrapOwnership == ownership) |
+ ? GrGpuResource::kAdopted_LifeCycle |
+ : GrGpuResource::kBorrowed_LifeCycle; |
GrSurfaceDesc desc; |
desc.fConfig = wrapDesc.fConfig; |