Commit 3cd7ca07 authored by WangHui's avatar WangHui Committed by Commit Bot

aw: Avoid Presentation feedback with bad frame token.

Move the logic of frame token check into RWHVA since the RWHVA maybe
reused with create a new compositor.

Bug:1103530

Change-Id: I69c5bbb7713e6054309d8d9a50188f48c6cbd74b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2288714
Commit-Queue: Bo <boliu@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789472}
parent 1c691244
...@@ -464,9 +464,6 @@ void SynchronousCompositorHost::DidPresentCompositorFrames( ...@@ -464,9 +464,6 @@ void SynchronousCompositorHost::DidPresentCompositorFrames(
void SynchronousCompositorHost::UpdatePresentedFrameToken( void SynchronousCompositorHost::UpdatePresentedFrameToken(
uint32_t frame_token) { uint32_t frame_token) {
if (!viz::FrameTokenGT(frame_token, last_frame_token_))
return;
last_frame_token_ = frame_token;
rwhva_->FrameTokenChangedForSynchronousCompositor(frame_token, rwhva_->FrameTokenChangedForSynchronousCompositor(frame_token,
root_scroll_offset_); root_scroll_offset_);
} }
......
...@@ -180,9 +180,6 @@ class CONTENT_EXPORT SynchronousCompositorHost ...@@ -180,9 +180,6 @@ class CONTENT_EXPORT SynchronousCompositorHost
float min_page_scale_factor_ = 0.f; float min_page_scale_factor_ = 0.f;
float max_page_scale_factor_ = 0.f; float max_page_scale_factor_ = 0.f;
// From viz display.
uint32_t last_frame_token_ = 0u;
scoped_refptr<SynchronousCompositorSyncCallBridge> bridge_; scoped_refptr<SynchronousCompositorSyncCallBridge> bridge_;
// Indicates whether and for what reason a request for begin frames has been // Indicates whether and for what reason a request for begin frames has been
......
...@@ -1104,6 +1104,10 @@ bool RenderWidgetHostViewAndroid::RequestRepaintForTesting() { ...@@ -1104,6 +1104,10 @@ bool RenderWidgetHostViewAndroid::RequestRepaintForTesting() {
void RenderWidgetHostViewAndroid::FrameTokenChangedForSynchronousCompositor( void RenderWidgetHostViewAndroid::FrameTokenChangedForSynchronousCompositor(
uint32_t frame_token, uint32_t frame_token,
const gfx::ScrollOffset& root_scroll_offset) { const gfx::ScrollOffset& root_scroll_offset) {
if (!viz::FrameTokenGT(frame_token, sync_compositor_last_frame_token_))
return;
sync_compositor_last_frame_token_ = frame_token;
if (host() && frame_token) { if (host() && frame_token) {
if (!using_viz_for_webview_) { if (!using_viz_for_webview_) {
// For viz it's reported through FrameSinkManager. // For viz it's reported through FrameSinkManager.
......
...@@ -502,6 +502,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid ...@@ -502,6 +502,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
const bool using_browser_compositor_; const bool using_browser_compositor_;
const bool using_viz_for_webview_; const bool using_viz_for_webview_;
std::unique_ptr<SynchronousCompositorHost> sync_compositor_; std::unique_ptr<SynchronousCompositorHost> sync_compositor_;
uint32_t sync_compositor_last_frame_token_ = 0u;
SynchronousCompositorClient* synchronous_compositor_client_; SynchronousCompositorClient* synchronous_compositor_client_;
......
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