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

Unified Diff: ui/aura/mus/window_port_mus.cc

Issue 2780043002: Aura-Mus: Allocate a LocalSurfaceId on size change (Closed)
Patch Set: Cleanup 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 | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index ab5dbabef5ec613aaf95798a000b1ac3d5bb667a..1f2f85eded6fca577016a0aca2fbcc4387360149 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -231,10 +231,17 @@ void WindowPortMus::ReorderFromServer(WindowMus* child,
window_->StackChildAbove(child->GetWindow(), relative->GetWindow());
}
-void WindowPortMus::SetBoundsFromServer(const gfx::Rect& bounds) {
+void WindowPortMus::SetBoundsFromServer(
+ const gfx::Rect& bounds,
+ const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
ServerChangeData data;
data.bounds_in_dip = bounds;
ScopedServerChange change(this, ServerChangeType::BOUNDS, data);
+ last_surface_size_ = bounds.size();
+ if (local_surface_id)
+ local_surface_id_ = *local_surface_id;
+ else
+ local_surface_id_ = cc::LocalSurfaceId();
window_->SetBounds(bounds);
}
@@ -284,6 +291,22 @@ void WindowPortMus::SetFrameSinkIdFromServer(
// then we are ready to embed.
}
+const cc::LocalSurfaceId& WindowPortMus::GetOrAllocateLocalSurfaceId(
+ const gfx::Size& surface_size) {
+ if (last_surface_size_ == surface_size && local_surface_id_.is_valid())
+ return local_surface_id_;
+
+ local_surface_id_ = local_surface_id_allocator_.GenerateId();
+ last_surface_size_ = surface_size;
+
+ // TODO(fsamuel): If surface synchronization is enabled and the FrameSinkId
+ // is available, then immediately embed the SurfaceId. The newly generated
+ // frame by the embedder will block in the display compositor until the
+ // child submits a corresponding CompositorFrame or a deadline hits.
+
+ return local_surface_id_;
+}
+
void WindowPortMus::SetSurfaceInfoFromServer(
const cc::SurfaceInfo& surface_info) {
if (surface_info_.is_valid()) {
@@ -363,6 +386,10 @@ WindowPortMus::ChangeSource WindowPortMus::OnTransientChildRemoved(
: ChangeSource::LOCAL;
}
+const cc::LocalSurfaceId& WindowPortMus::GetLocalSurfaceId() {
+ return local_surface_id_;
+}
+
std::unique_ptr<WindowMusChangeData>
WindowPortMus::PrepareForServerBoundsChange(const gfx::Rect& bounds) {
std::unique_ptr<WindowMusChangeDataImpl> data(
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698