Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: src/gpu/vk/GrVkGpu.cpp

Issue 1782453004: Fix some issues for Linux Vulkan build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/vk/GrVkImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/gpu/vk/GrVkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698