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

Unified Diff: content/renderer/mus/renderer_window_tree_client.cc

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: First cut propagating LocalSurfaceId when WindowTreeHost requests resize Created 3 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 | « content/renderer/mus/renderer_window_tree_client.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mus/renderer_window_tree_client.cc
diff --git a/content/renderer/mus/renderer_window_tree_client.cc b/content/renderer/mus/renderer_window_tree_client.cc
index 8cb2e6572ecd1fb25ff4845ff28c7269d4b496a9..f6d859723992e525293c5668c4bda7a6c050de48 100644
--- a/content/renderer/mus/renderer_window_tree_client.cc
+++ b/content/renderer/mus/renderer_window_tree_client.cc
@@ -6,7 +6,13 @@
#include <map>
+#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "cc/base/switches.h"
+#include "content/renderer/gpu/render_widget_compositor.h"
+#include "content/renderer/render_frame_impl.h"
+#include "content/renderer/render_view_impl.h"
+#include "content/renderer/render_widget.h"
#include "services/ui/public/cpp/client_compositor_frame_sink.h"
namespace content {
@@ -139,7 +145,24 @@ void RendererWindowTreeClient::OnWindowBoundsChanged(
ui::Id window_id,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
- const base::Optional<cc::LocalSurfaceId>& local_surface_id) {}
+ const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ cc::switches::kEnableSurfaceSynchronization)) {
+ return;
+ }
+ current_local_surface_id_ = *local_surface_id;
+ RenderFrameImpl* render_frame = RenderFrameImpl::FromRoutingID(routing_id_);
+ RenderViewImpl* render_view = RenderViewImpl::FromRoutingID(routing_id_);
+ if (!render_frame && !render_view)
+ return;
+ RenderWidget* widget =
+ render_frame ? render_frame->GetRenderWidget() : render_view->GetWidget();
+ if (!widget)
+ return;
+ // TODO(fsamuel): This isn't quite correct. The resize arrives from the
+ // browser and so it might not synchronize with the LocalSurfaceId.
+ widget->compositor()->SetLocalSurfaceId(*local_surface_id);
+}
void RendererWindowTreeClient::OnClientAreaChanged(
uint32_t window_id,
@@ -247,6 +270,11 @@ void RendererWindowTreeClient::OnPerformDragDropCompleted(
void RendererWindowTreeClient::OnDragDropDone() {}
+void RendererWindowTreeClient::OnSetWindowBoundsResponse(
+ uint32_t change_id,
+ const gfx::Rect& bounds,
+ const cc::LocalSurfaceId& local_surface_id) {}
+
void RendererWindowTreeClient::OnChangeCompleted(uint32_t change_id,
bool success) {}
« no previous file with comments | « content/renderer/mus/renderer_window_tree_client.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698