Commit 24a93997 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Fix a crash with SkiaRenderer + DDL + Vulkan.

With vulkan, if a client (renderer, ui, etc) creates a texture with
wrong interface(GLES2Interface), the viz process will crash without
any useful information. This CL will fix the problem by logging a
error message instead of crashing.

Bug: 838899
Change-Id: I8e0c5ba162f8e4de3b0bd10899944c6b0ea89272
Reviewed-on: https://chromium-review.googlesource.com/c/1342802
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609440}
parent 0ce5f96e
...@@ -330,6 +330,13 @@ void SkiaOutputSurfaceImplOnGpu::FulfillPromiseTexture( ...@@ -330,6 +330,13 @@ void SkiaOutputSurfaceImplOnGpu::FulfillPromiseTexture(
return; return;
} }
if (gpu_service_->is_using_vulkan()) {
// Probably this texture is created with wrong inteface (GLES2Interface).
DLOG(ERROR) << "Failed to fulfill the promise texture whose backend is not "
"compitable with vulkan.";
return;
}
auto* mailbox_manager = gpu_service_->mailbox_manager(); auto* mailbox_manager = gpu_service_->mailbox_manager();
auto* texture_base = mailbox_manager->ConsumeTexture(metadata.mailbox); auto* texture_base = mailbox_manager->ConsumeTexture(metadata.mailbox);
if (!texture_base) { if (!texture_base) {
......
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