Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: content/browser/android/synchronous_compositor_host.cc

Issue 2457333002: sync compositor: Keep draw after ComputeScroll synchronous (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/android/synchronous_compositor_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/synchronous_compositor_host.cc
diff --git a/content/browser/android/synchronous_compositor_host.cc b/content/browser/android/synchronous_compositor_host.cc
index 2b588aed0b0f2186c0579d280b63ef64ad1ac6da..c0d33fbc765cfa4305ed9054b46c57b0c434746b 100644
--- a/content/browser/android/synchronous_compositor_host.cc
+++ b/content/browser/android/synchronous_compositor_host.cc
@@ -104,10 +104,19 @@ SynchronousCompositorHost::DemandDrawHwAsync(
const gfx::Size& viewport_size,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority) {
+ scoped_refptr<FrameFuture> frame_future = new FrameFuture();
+ if (compute_scroll_needs_synchronous_draw_) {
+ compute_scroll_needs_synchronous_draw_ = false;
+ auto frame_ptr = base::MakeUnique<Frame>();
+ *frame_ptr = DemandDrawHw(viewport_size, viewport_rect_for_tile_priority,
+ transform_for_tile_priority);
+ frame_future->SetFrame(std::move(frame_ptr));
+ return frame_future;
+ }
+
SyncCompositorDemandDrawHwParams params(viewport_size,
viewport_rect_for_tile_priority,
transform_for_tile_priority);
- scoped_refptr<FrameFuture> frame_future = new FrameFuture();
if (SynchronousCompositorBrowserFilter* filter = GetFilter()) {
if (!registered_with_filter_) {
filter->RegisterHost(this);
@@ -363,6 +372,7 @@ void SynchronousCompositorHost::OnComputeScroll(
SyncCompositorCommonRendererParams common_renderer_params;
sender_->Send(
new SyncCompositorMsg_ComputeScroll(routing_id_, animation_time));
+ compute_scroll_needs_synchronous_draw_ = true;
}
void SynchronousCompositorHost::DidOverscroll(
@@ -374,6 +384,7 @@ void SynchronousCompositorHost::DidOverscroll(
void SynchronousCompositorHost::DidSendBeginFrame(
ui::WindowAndroid* window_android) {
+ compute_scroll_needs_synchronous_draw_ = false;
if (SynchronousCompositorBrowserFilter* filter = GetFilter())
filter->SyncStateAfterVSync(window_android, this);
}
« no previous file with comments | « content/browser/android/synchronous_compositor_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698