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

Unified Diff: cc/trees/remote_channel_impl.cc

Issue 1831083002: cc: Force a redraw on initializing a new output surface for remote compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed updating the test. Created 4 years, 9 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 | « cc/trees/remote_channel_impl.h ('k') | cc/trees/remote_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/remote_channel_impl.cc
diff --git a/cc/trees/remote_channel_impl.cc b/cc/trees/remote_channel_impl.cc
index 5d98369af5674c3b791f02a4da8d703c3e857986..a55dc9770be51cb2937e6af31bc584368f782cc4 100644
--- a/cc/trees/remote_channel_impl.cc
+++ b/cc/trees/remote_channel_impl.cc
@@ -139,9 +139,7 @@ void RemoteChannelImpl::HandleProto(
proto.set_needs_redraw_message();
gfx::Rect damaged_rect =
ProtoToRect(set_needs_redraw_message.damaged_rect());
- ImplThreadTaskRunner()->PostTask(
- FROM_HERE, base::Bind(&ProxyImpl::SetNeedsRedrawOnImpl,
- proxy_impl_weak_ptr_, damaged_rect));
+ PostSetNeedsRedrawToImpl(damaged_rect);
} break;
}
}
@@ -428,6 +426,11 @@ void RemoteChannelImpl::DidInitializeOutputSurfaceOnMain(
HandleProto(main().pending_messages.front());
main().pending_messages.pop();
}
+
+ // The commit after a new output surface can early out, in which case we will
+ // never redraw. Schedule one just to be safe.
+ PostSetNeedsRedrawToImpl(
+ gfx::Rect(main().layer_tree_host->device_viewport_size()));
}
void RemoteChannelImpl::SendMessageProtoOnMain(
@@ -437,6 +440,15 @@ void RemoteChannelImpl::SendMessageProtoOnMain(
main().remote_proto_channel->SendCompositorProto(*proto);
}
+void RemoteChannelImpl::PostSetNeedsRedrawToImpl(
+ const gfx::Rect& damaged_rect) {
+ DCHECK(task_runner_provider_->IsMainThread());
+
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::SetNeedsRedrawOnImpl,
+ proxy_impl_weak_ptr_, damaged_rect));
+}
+
void RemoteChannelImpl::InitializeImplOnImpl(CompletionEvent* completion,
LayerTreeHost* layer_tree_host) {
DCHECK(task_runner_provider_->IsMainThreadBlocked());
« no previous file with comments | « cc/trees/remote_channel_impl.h ('k') | cc/trees/remote_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698