Commit f694865e authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Fix crashes related to low end device mode with vulkan.

Bug: 1015156
Change-Id: Iac379910bc94f003f5911134309c99d92b58cffe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2023364Reviewed-by: default avatarSaman Sami <samans@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735678}
parent 850e5b71
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#include "content/renderer/render_widget_screen_metrics_emulator.h" #include "content/renderer/render_widget_screen_metrics_emulator.h"
#include "content/renderer/renderer_blink_platform_impl.h" #include "content/renderer/renderer_blink_platform_impl.h"
#include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/config/gpu_finch_features.h"
#include "ipc/ipc_message_start.h" #include "ipc/ipc_message_start.h"
#include "ipc/ipc_sync_message.h" #include "ipc/ipc_sync_message.h"
#include "ipc/ipc_sync_message_filter.h" #include "ipc/ipc_sync_message_filter.h"
...@@ -3125,9 +3126,13 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( ...@@ -3125,9 +3126,13 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
// - If the user hasn't explicitly disabled them // - If the user hasn't explicitly disabled them
// - If system ram is <= 512MB (1GB devices are sometimes low-end). // - If system ram is <= 512MB (1GB devices are sometimes low-end).
// - If we are not running in a WebView, where 4444 isn't supported. // - If we are not running in a WebView, where 4444 isn't supported.
// - If we are not using vulkan, since some GPU drivers don't support
// using RGBA4444 as color buffer.
// TODO(penghuang): query supported formats from GPU process.
if (!cmd.HasSwitch(switches::kDisableRGBA4444Textures) && if (!cmd.HasSwitch(switches::kDisableRGBA4444Textures) &&
base::SysInfo::AmountOfPhysicalMemoryMB() <= 512 && base::SysInfo::AmountOfPhysicalMemoryMB() <= 512 &&
!using_synchronous_compositor) { !using_synchronous_compositor &&
!base::FeatureList::IsEnabled(features::kVulkan)) {
settings.use_rgba_4444 = viz::RGBA_4444; settings.use_rgba_4444 = viz::RGBA_4444;
// If we are going to unpremultiply and dither these tiles, we need to // If we are going to unpremultiply and dither these tiles, we need to
......
...@@ -174,8 +174,11 @@ class WrappedSkImage : public ClearTrackingSharedImageBacking { ...@@ -174,8 +174,11 @@ class WrappedSkImage : public ClearTrackingSharedImageBacking {
#endif #endif
} }
if (!backend_texture_.isValid()) if (!backend_texture_.isValid()) {
DLOG(ERROR) << "createBackendTexture() failed with SkColorType:"
<< GetSkColorType();
return false; return false;
}
promise_texture_ = SkPromiseImageTexture::Make(backend_texture_); promise_texture_ = SkPromiseImageTexture::Make(backend_texture_);
......
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