aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-03-09 09:57:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-09 09:57:52 -0800
commit0fcfb7525f60eabfdaf9761c75c7d4fd1b46d0c5 (patch)
treef4b370b9cb2265fd3d208c7d70a52e1bfd37c91b /src/gpu
parent5b592e8d0998d89a077a098b9d912c06ccebd8d8 (diff)
Fix some issues for Linux Vulkan build
lifecycle in GrVkGpu was tagged as uninitialized before use, and err in GrVkImage as unused. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1782453004 Review URL: https://codereview.chromium.org/1782453004
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/vk/GrVkGpu.cpp24
-rw-r--r--src/gpu/vk/GrVkImage.cpp7
2 files changed, 8 insertions, 23 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index d357f32e1f..db520faad1 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -584,15 +584,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
@@ -628,15 +622,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;
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp
index a87a7a5a49..a61d934b72 100644
--- a/src/gpu/vk/GrVkImage.cpp
+++ b/src/gpu/vk/GrVkImage.cpp
@@ -49,8 +49,6 @@ const GrVkImage::Resource* GrVkImage::CreateResource(const GrVkGpu* gpu,
VkImage image = 0;
VkDeviceMemory alloc;
- VkResult err;
-
VkImageLayout initialLayout = (VK_IMAGE_TILING_LINEAR == imageDesc.fImageTiling)
? VK_IMAGE_LAYOUT_PREINITIALIZED
: VK_IMAGE_LAYOUT_UNDEFINED;
@@ -78,8 +76,7 @@ const GrVkImage::Resource* GrVkImage::CreateResource(const GrVkGpu* gpu,
initialLayout // initialLayout
};
- err = VK_CALL(gpu, CreateImage(gpu->device(), &imageCreateInfo, nullptr, &image));
- SkASSERT(!err);
+ GR_VK_CALL_ERRCHECK(gpu->vkInterface(), CreateImage(gpu->device(), &imageCreateInfo, nullptr, &image));
if (!GrVkMemory::AllocAndBindImageMemory(gpu, image, imageDesc.fMemProps, &alloc)) {
VK_CALL(gpu, DestroyImage(gpu->device(), image, nullptr));
@@ -115,4 +112,4 @@ void GrVkImage::abandonImage() {
void GrVkImage::Resource::freeGPUData(const GrVkGpu* gpu) const {
VK_CALL(gpu, DestroyImage(gpu->device(), fImage, nullptr));
VK_CALL(gpu, FreeMemory(gpu->device(), fAlloc, nullptr));
-} \ No newline at end of file
+}