| 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(
|
|
|