Commit 392cff86 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Make browser UI to use OOPR as well when OOPR is enabled.

Bug: None
Change-Id: Ic6b61b87089688a0b7230748408ef146ce6e1925
Reviewed-on: https://chromium-review.googlesource.com/c/1299333Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603112}
parent a75d6f1d
......@@ -56,6 +56,7 @@ scoped_refptr<ws::ContextProviderCommandBuffer> CreateContextProviderImpl(
bool support_gles2_interface,
bool support_raster_interface,
bool support_grcontext,
bool support_oop_rasterization,
ws::command_buffer_metrics::ContextType type) {
constexpr bool kAutomaticFlushes = false;
......@@ -70,6 +71,7 @@ scoped_refptr<ws::ContextProviderCommandBuffer> CreateContextProviderImpl(
attributes.buffer_preserved = false;
attributes.enable_gles2_interface = support_gles2_interface;
attributes.enable_raster_interface = support_raster_interface;
attributes.enable_oop_rasterization = support_oop_rasterization;
gpu::SharedMemoryLimits memory_limits =
gpu::SharedMemoryLimits::ForDisplayCompositor();
......@@ -403,10 +405,10 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(
if (!gpu_channel_host)
return gpu::ContextResult::kFatalFailure;
const auto& gpu_feature_info = gpu_channel_host->gpu_feature_info();
// Fallback to software compositing if GPU compositing is blacklisted.
auto gpu_compositing_status =
gpu_channel_host->gpu_feature_info()
.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING];
gpu_feature_info.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING];
if (gpu_compositing_status != gpu::kGpuFeatureStatusEnabled)
return gpu::ContextResult::kFatalFailure;
......@@ -414,19 +416,24 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(
IsWorkerContextLost(worker_context_provider_.get()))
worker_context_provider_.reset();
bool enable_oop_rasterization =
gpu_feature_info.status_values[gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION] ==
gpu::kGpuFeatureStatusEnabled;
if (!worker_context_provider_) {
constexpr bool kSharedWorkerContextSupportsLocking = true;
constexpr bool kSharedWorkerContextSupportsRaster = true;
const bool kSharedWorkerContextSupportsGLES2 =
features::IsUiGpuRasterizationEnabled();
features::IsUiGpuRasterizationEnabled() && !enable_oop_rasterization;
const bool kSharedWorkerContextSupportsGrContext =
features::IsUiGpuRasterizationEnabled();
features::IsUiGpuRasterizationEnabled() && !enable_oop_rasterization;
const bool kSharedWorkerContextSupportsOOPR = enable_oop_rasterization;
worker_context_provider_ = CreateContextProviderImpl(
gpu_channel_host, GetGpuMemoryBufferManager(),
kSharedWorkerContextSupportsLocking, kSharedWorkerContextSupportsGLES2,
kSharedWorkerContextSupportsRaster,
kSharedWorkerContextSupportsGrContext,
kSharedWorkerContextSupportsGrContext, kSharedWorkerContextSupportsOOPR,
ws::command_buffer_metrics::ContextType::BROWSER_WORKER);
// Don't observer context loss on |worker_context_provider_| here, that is
......@@ -449,11 +456,13 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(
constexpr bool kCompositorContextSupportsGLES2 = true;
constexpr bool kCompositorContextSupportsRaster = false;
constexpr bool kCompositorContextSupportsGrContext = true;
constexpr bool kCompositorContextSupportsOOPR = false;
main_context_provider_ = CreateContextProviderImpl(
std::move(gpu_channel_host), GetGpuMemoryBufferManager(),
kCompositorContextSupportsLocking, kCompositorContextSupportsGLES2,
kCompositorContextSupportsRaster, kCompositorContextSupportsGrContext,
kCompositorContextSupportsOOPR,
ws::command_buffer_metrics::ContextType::BROWSER_MAIN_THREAD);
main_context_provider_->SetDefaultTaskRunner(resize_task_runner());
......
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