Commit 21d96a44 authored by Sean Gilhuly's avatar Sean Gilhuly Committed by Commit Bot

Add check for --disable-frame-rate-limit

The flag is not respected with OOP-D, so read the flag and send it to
the GPU process.

Bug: 841801
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I87644f9c10a04491289f9fe89b8cbbd9584bfb2a
Reviewed-on: https://chromium-review.googlesource.com/1228497
Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592029}
parent 50689e69
...@@ -54,10 +54,18 @@ RootCompositorFrameSinkImpl::Create( ...@@ -54,10 +54,18 @@ RootCompositorFrameSinkImpl::Create(
external_begin_frame_source = external_begin_frame_source =
std::make_unique<ExternalBeginFrameSourceAndroid>(restart_id); std::make_unique<ExternalBeginFrameSourceAndroid>(restart_id);
#else #else
synthetic_begin_frame_source = std::make_unique<DelayBasedBeginFrameSource>( if (params->disable_frame_rate_limit) {
std::make_unique<DelayBasedTimeSource>( synthetic_begin_frame_source =
base::ThreadTaskRunnerHandle::Get().get()), std::make_unique<BackToBackBeginFrameSource>(
restart_id); std::make_unique<DelayBasedTimeSource>(
base::ThreadTaskRunnerHandle::Get().get()));
} else {
synthetic_begin_frame_source =
std::make_unique<DelayBasedBeginFrameSource>(
std::make_unique<DelayBasedTimeSource>(
base::ThreadTaskRunnerHandle::Get().get()),
restart_id);
}
#endif #endif
} }
......
...@@ -27,6 +27,8 @@ struct RootCompositorFrameSinkParams { ...@@ -27,6 +27,8 @@ struct RootCompositorFrameSinkParams {
bool gpu_compositing = true; bool gpu_compositing = true;
RendererSettings renderer_settings; RendererSettings renderer_settings;
bool send_swap_size_notifications = false; bool send_swap_size_notifications = false;
// Disables begin frame rate limiting for the display compositor.
bool disable_frame_rate_limit = false;
associated CompositorFrameSink& compositor_frame_sink; associated CompositorFrameSink& compositor_frame_sink;
CompositorFrameSinkClient compositor_frame_sink_client; CompositorFrameSinkClient compositor_frame_sink_client;
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
#include "ui/compositor/host/host_context_factory_private.h" #include "ui/compositor/host/host_context_factory_private.h"
#include "base/command_line.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "cc/mojo_embedder/async_layer_tree_frame_sink.h" #include "cc/mojo_embedder/async_layer_tree_frame_sink.h"
#include "components/viz/client/hit_test_data_provider_draw_quad.h" #include "components/viz/client/hit_test_data_provider_draw_quad.h"
#include "components/viz/client/local_surface_id_provider.h" #include "components/viz/client/local_surface_id_provider.h"
#include "components/viz/common/switches.h"
#include "components/viz/host/host_display_client.h" #include "components/viz/host/host_display_client.h"
#include "components/viz/host/host_frame_sink_manager.h" #include "components/viz/host/host_frame_sink_manager.h"
#include "components/viz/host/renderer_settings_creation.h" #include "components/viz/host/renderer_settings_creation.h"
...@@ -94,6 +96,10 @@ void HostContextFactoryPrivate::ConfigureCompositor( ...@@ -94,6 +96,10 @@ void HostContextFactoryPrivate::ConfigureCompositor(
root_params->gpu_compositing = gpu_compositing; root_params->gpu_compositing = gpu_compositing;
root_params->renderer_settings = renderer_settings_; root_params->renderer_settings = renderer_settings_;
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableFrameRateLimit))
root_params->disable_frame_rate_limit = true;
// Connects the viz process end of CompositorFrameSink message pipes. The // Connects the viz process end of CompositorFrameSink message pipes. The
// browser compositor may request a new CompositorFrameSink on context loss, // browser compositor may request a new CompositorFrameSink on context loss,
// which will destroy the existing CompositorFrameSink. // which will destroy the existing CompositorFrameSink.
......
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