Commit 4d49b6d2 authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

Change LOG(FATAL) into context lost

The use experience is largely the same, but it is very different from
our crash reporting perspective. Lost context shutdowns are clean and
don't show up as a crash report.

They are treated similarly by GPU blacklisting.

Bug: 1026872
Change-Id: I00559c7ef5276fe6c7c9aee832ff016a0a755156
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1929153
Commit-Queue: Jonathan Backer <backer@chromium.org>
Auto-Submit: Jonathan Backer <backer@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718264}
parent 059001c3
......@@ -50,7 +50,8 @@ bool SkiaOutputDeviceVulkan::Reshape(const gfx::Size& size,
uint32_t generation = 0;
if (!vulkan_surface_) {
CreateVulkanSurface();
if (!CreateVulkanSurface())
return false;
} else {
generation = vulkan_surface_->swap_chain_generation();
}
......@@ -147,7 +148,7 @@ void SkiaOutputDeviceVulkan::EndPaint(const GrBackendSemaphore& semaphore) {
scoped_write_.reset();
}
void SkiaOutputDeviceVulkan::CreateVulkanSurface() {
bool SkiaOutputDeviceVulkan::CreateVulkanSurface() {
gfx::AcceleratedWidget accelerated_widget = gfx::kNullAcceleratedWidget;
#if defined(OS_ANDROID)
bool can_be_used_with_surface_control = false;
......@@ -160,13 +161,17 @@ void SkiaOutputDeviceVulkan::CreateVulkanSurface() {
auto vulkan_surface =
context_provider_->GetVulkanImplementation()->CreateViewSurface(
accelerated_widget);
if (!vulkan_surface)
LOG(FATAL) << "Failed to create vulkan surface.";
if (!vulkan_surface) {
LOG(ERROR) << "Failed to create vulkan surface.";
return false;
}
if (!vulkan_surface->Initialize(context_provider_->GetDeviceQueue(),
gpu::VulkanSurface::FORMAT_RGBA_32)) {
LOG(FATAL) << "Failed to initialize vulkan surface.";
LOG(ERROR) << "Failed to initialize vulkan surface.";
return false;
}
vulkan_surface_ = std::move(vulkan_surface);
return true;
}
} // namespace viz
......@@ -42,7 +42,7 @@ class SkiaOutputDeviceVulkan final : public SkiaOutputDevice {
void EndPaint(const GrBackendSemaphore& semaphore) override;
private:
void CreateVulkanSurface();
bool CreateVulkanSurface();
void CreateSkSurface();
VulkanContextProvider* const context_provider_;
......
......@@ -1369,7 +1369,7 @@ bool SkiaOutputSurfaceImplOnGpu::InitializeForGL() {
} else {
gl_surface_ = nullptr;
context_state_ = nullptr;
LOG(FATAL) << "Failed to make current during initialization.";
LOG(ERROR) << "Failed to make current during initialization.";
return false;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment