Skip to content

Commit

Permalink
Remove ProxyImpl::input_throttled_until_commit_ and associated code
Browse files Browse the repository at this point in the history
This patch removes ProxyImpl::input_throttled_until_commit_ and

used.

ProxyImpl: :SetInputThrottledUntilCommitOnImpl and
ProxyMain: :NotifyInputThrottledUntilCommit because the code is no longer
Change-Id: Ic73f9177d8a42e4e84a8265855550976b01e2021
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525320
Reviewed-by: enne <[email protected]>
Commit-Queue: Philip Rogers <[email protected]>
Cr-Commit-Position: refs/heads/master@{#641743}
  • Loading branch information
progers authored and Commit Bot committed Mar 18, 2019
1 parent e00f5d8 commit f3d3c67
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 43 deletions.
1 change: 0 additions & 1 deletion cc/test/fake_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class FakeProxy : public Proxy {
void SetNeedsRedraw(const gfx::Rect& damage_rect) override {}
void SetNextCommitWaitsForActivation() override {}
bool RequestedAnimatePending() override;
void NotifyInputThrottledUntilCommit() override {}
void SetDeferMainFrameUpdate(bool defer_main_frame_update) override {}
void StartDeferringCommits(base::TimeDelta timeout) override {}
void StopDeferringCommits() override {}
Expand Down
4 changes: 0 additions & 4 deletions cc/trees/layer_tree_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,6 @@ bool LayerTreeHost::IsVisible() const {
return visible_;
}

void LayerTreeHost::NotifyInputThrottledUntilCommit() {
proxy_->NotifyInputThrottledUntilCommit();
}

void LayerTreeHost::LayoutAndUpdateLayers() {
DCHECK(IsSingleThreaded());
// This function is only valid when not using the scheduler.
Expand Down
5 changes: 0 additions & 5 deletions cc/trees/layer_tree_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {

// Input Handling ---------------------------------------------

// Notifies the compositor that input from the browser is being throttled till
// the next commit. The compositor will prioritize activation of the pending
// tree so a commit can be performed.
void NotifyInputThrottledUntilCommit();

// Sets the state of the browser controls. (Used for URL bar animations on
// android).
void UpdateBrowserControlsState(BrowserControlsState constraints,
Expand Down
2 changes: 0 additions & 2 deletions cc/trees/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class CC_EXPORT Proxy {
// completed yet.
virtual bool RequestedAnimatePending() = 0;

virtual void NotifyInputThrottledUntilCommit() = 0;

// Defers LayerTreeHost::BeginMainFrameUpdate and commits until it is
// reset. It is only supported when using a scheduler.
virtual void SetDeferMainFrameUpdate(bool defer_main_frame_update) = 0;
Expand Down
16 changes: 1 addition & 15 deletions cc/trees/proxy_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ ProxyImpl::ProxyImpl(base::WeakPtr<ProxyMain> proxy_main_weak_ptr,
commit_completion_waits_for_activation_(false),
next_frame_is_newly_committed_frame_(false),
inside_draw_(false),
input_throttled_until_commit_(false),
task_runner_provider_(task_runner_provider),
smoothness_priority_expiration_notifier_(
task_runner_provider->ImplThreadTaskRunner(),
Expand Down Expand Up @@ -167,14 +166,6 @@ void ProxyImpl::InitializeLayerTreeFrameSinkOnImpl(
scheduler_->DidCreateAndInitializeLayerTreeFrameSink();
}

void ProxyImpl::SetInputThrottledUntilCommitOnImpl(bool is_throttled) {
DCHECK(IsImplThread());
if (is_throttled == input_throttled_until_commit_)
return;
input_throttled_until_commit_ = is_throttled;
RenewTreePriority();
}

void ProxyImpl::SetDeferBeginMainFrameOnImpl(
bool defer_begin_main_frame) const {
DCHECK(IsImplThread());
Expand All @@ -201,9 +192,6 @@ void ProxyImpl::BeginMainFrameAbortedOnImpl(
DCHECK(IsImplThread());
DCHECK(scheduler_->CommitPending());

if (CommitEarlyOutHandledCommit(reason)) {
SetInputThrottledUntilCommitOnImpl(false);
}
host_impl_->BeginMainFrameAborted(reason, std::move(swap_promises));
scheduler_->NotifyBeginMainFrameStarted(main_thread_start_time);
scheduler_->BeginMainFrameAborted(reason);
Expand Down Expand Up @@ -426,7 +414,7 @@ void ProxyImpl::RenewTreePriority() {

// New content always takes priority when ui resources have been evicted.
if (host_impl_->active_tree()->GetDeviceViewport().size().IsEmpty() ||
host_impl_->EvictedUIResourcesExist() || input_throttled_until_commit_) {
host_impl_->EvictedUIResourcesExist()) {
// Once we enter NEW_CONTENTS_TAKES_PRIORITY mode, visible tiles on active
// tree might be freed. We need to set RequiresHighResToDraw to ensure that
// high res tiles will be required to activate pending tree.
Expand Down Expand Up @@ -632,8 +620,6 @@ void ProxyImpl::ScheduledActionCommit() {
// often a good bit of work to update the tree and prepare the new frame.
host_impl_->CommitComplete();

SetInputThrottledUntilCommitOnImpl(false);

next_frame_is_newly_committed_frame_ = true;
}

Expand Down
2 changes: 0 additions & 2 deletions cc/trees/proxy_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class CC_EXPORT ProxyImpl : public LayerTreeHostImplClient,
void InitializeMutatorOnImpl(std::unique_ptr<LayerTreeMutator> mutator);
void InitializePaintWorkletLayerPainterOnImpl(
std::unique_ptr<PaintWorkletLayerPainter> painter);
void SetInputThrottledUntilCommitOnImpl(bool is_throttled);
void SetDeferBeginMainFrameOnImpl(bool defer_begin_main_frame) const;
void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect);
void SetNeedsCommitOnImpl();
Expand Down Expand Up @@ -164,7 +163,6 @@ class CC_EXPORT ProxyImpl : public LayerTreeHostImplClient,
bool next_frame_is_newly_committed_frame_;

bool inside_draw_;
bool input_throttled_until_commit_;

bool send_compositor_frame_ack_;

Expand Down
7 changes: 0 additions & 7 deletions cc/trees/proxy_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,6 @@ bool ProxyMain::RequestedAnimatePending() {
return max_requested_pipeline_stage_ >= ANIMATE_PIPELINE_STAGE;
}

void ProxyMain::NotifyInputThrottledUntilCommit() {
DCHECK(IsMainThread());
ImplThreadTaskRunner()->PostTask(
FROM_HERE, base::BindOnce(&ProxyImpl::SetInputThrottledUntilCommitOnImpl,
base::Unretained(proxy_impl_.get()), true));
}

void ProxyMain::SetDeferMainFrameUpdate(bool defer_main_frame_update) {
DCHECK(IsMainThread());
if (defer_main_frame_update_ == defer_main_frame_update)
Expand Down
1 change: 0 additions & 1 deletion cc/trees/proxy_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class CC_EXPORT ProxyMain : public Proxy {
void SetNeedsRedraw(const gfx::Rect& damage_rect) override;
void SetNextCommitWaitsForActivation() override;
bool RequestedAnimatePending() override;
void NotifyInputThrottledUntilCommit() override;
void SetDeferMainFrameUpdate(bool defer_main_frame_update) override;
void StartDeferringCommits(base::TimeDelta timeout) override;
void StopDeferringCommits() override;
Expand Down
1 change: 0 additions & 1 deletion cc/trees/single_thread_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
void SetNeedsRedraw(const gfx::Rect& damage_rect) override;
void SetNextCommitWaitsForActivation() override;
bool RequestedAnimatePending() override;
void NotifyInputThrottledUntilCommit() override {}
void SetDeferMainFrameUpdate(bool defer_main_frame_update) override;
void StartDeferringCommits(base::TimeDelta timeout) override;
void StopDeferringCommits() override;
Expand Down
4 changes: 0 additions & 4 deletions content/renderer/compositor/layer_tree_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ int LayerTreeView::GetSourceFrameNumber() const {
return layer_tree_host_->SourceFrameNumber();
}

void LayerTreeView::NotifyInputThrottledUntilCommit() {
layer_tree_host_->NotifyInputThrottledUntilCommit();
}

const cc::Layer* LayerTreeView::GetRootLayer() const {
return layer_tree_host_->root_layer();
}
Expand Down
1 change: 0 additions & 1 deletion content/renderer/compositor/layer_tree_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class LayerTreeView : public blink::WebLayerTreeView,
// LayerTreeHost.
void QueueSwapPromise(std::unique_ptr<cc::SwapPromise> swap_promise);
int GetSourceFrameNumber() const;
void NotifyInputThrottledUntilCommit();
const cc::Layer* GetRootLayer() const;
int ScheduleMicroBenchmark(
const std::string& name,
Expand Down

0 comments on commit f3d3c67

Please sign in to comment.