| Index: content/browser/compositor/browser_compositor_output_surface.cc
|
| diff --git a/content/browser/compositor/browser_compositor_output_surface.cc b/content/browser/compositor/browser_compositor_output_surface.cc
|
| index f6141ca0d5db8139645791f23dc8180779869269..9e73923ab3a4ed93af7d66d20b17005f0e5a131e 100644
|
| --- a/content/browser/compositor/browser_compositor_output_surface.cc
|
| +++ b/content/browser/compositor/browser_compositor_output_surface.cc
|
| @@ -11,7 +11,6 @@
|
| #include "base/location.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/strings/string_number_conversions.h"
|
| -#include "cc/base/switches.h"
|
| #include "cc/output/output_surface_client.h"
|
| #include "cc/scheduler/begin_frame_source.h"
|
| #include "components/display_compositor/compositor_overlay_candidate_validator.h"
|
| @@ -29,10 +28,7 @@ BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
|
| : OutputSurface(std::move(context_provider), nullptr, nullptr),
|
| vsync_manager_(std::move(vsync_manager)),
|
| synthetic_begin_frame_source_(begin_frame_source),
|
| - reflector_(nullptr),
|
| - use_begin_frame_scheduling_(
|
| - !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - cc::switches::kDisableBeginFrameScheduling)) {
|
| + reflector_(nullptr) {
|
| overlay_candidate_validator_ = std::move(overlay_candidate_validator);
|
| Initialize();
|
| }
|
| @@ -44,10 +40,7 @@ BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
|
| : OutputSurface(nullptr, nullptr, std::move(software_device)),
|
| vsync_manager_(vsync_manager),
|
| synthetic_begin_frame_source_(begin_frame_source),
|
| - reflector_(nullptr),
|
| - use_begin_frame_scheduling_(
|
| - !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - cc::switches::kDisableBeginFrameScheduling)) {
|
| + reflector_(nullptr) {
|
| Initialize();
|
| }
|
|
|
| @@ -66,57 +59,21 @@ BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() {
|
| if (reflector_)
|
| reflector_->DetachFromOutputSurface();
|
| DCHECK(!reflector_);
|
| - if (!HasClient())
|
| - return;
|
| -
|
| - // When BeginFrame scheduling is enabled, vsync info is not routed to renderer
|
| - // by using |vsync_manager_|. Instead, BeginFrame message is used.
|
| - if (!use_begin_frame_scheduling_)
|
| - vsync_manager_->RemoveObserver(this);
|
| }
|
|
|
| void BrowserCompositorOutputSurface::Initialize() {
|
| capabilities_.adjust_deadline_for_parent = false;
|
| }
|
|
|
| -bool BrowserCompositorOutputSurface::BindToClient(
|
| - cc::OutputSurfaceClient* client) {
|
| - if (!OutputSurface::BindToClient(client))
|
| - return false;
|
| -
|
| - // Don't want vsync notifications until there is a client.
|
| - if (!use_begin_frame_scheduling_)
|
| - vsync_manager_->AddObserver(this);
|
| - return true;
|
| -}
|
| -
|
| -void BrowserCompositorOutputSurface::UpdateVSyncParametersInternal(
|
| +void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu(
|
| base::TimeTicks timebase,
|
| base::TimeDelta interval) {
|
| + DCHECK(HasClient());
|
| if (interval.is_zero()) {
|
| // TODO(brianderson): We should not be receiving 0 intervals.
|
| interval = cc::BeginFrameArgs::DefaultInterval();
|
| }
|
| synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval);
|
| -}
|
| -
|
| -void BrowserCompositorOutputSurface::OnUpdateVSyncParameters(
|
| - base::TimeTicks timebase,
|
| - base::TimeDelta interval) {
|
| - DCHECK(HasClient());
|
| - DCHECK(!use_begin_frame_scheduling_);
|
| - UpdateVSyncParametersInternal(timebase, interval);
|
| -}
|
| -
|
| -void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu(
|
| - base::TimeTicks timebase,
|
| - base::TimeDelta interval) {
|
| - DCHECK(HasClient());
|
| - if (use_begin_frame_scheduling_) {
|
| - UpdateVSyncParametersInternal(timebase, interval);
|
| - return;
|
| - }
|
| -
|
| vsync_manager_->UpdateVSyncParameters(timebase, interval);
|
| }
|
|
|
|
|