OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/window_tree_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
693 const gfx::Rect& new_bounds) { | 693 const gfx::Rect& new_bounds) { |
694 const uint32_t change_id = | 694 const uint32_t change_id = |
695 ScheduleInFlightChange(base::MakeUnique<InFlightBoundsChange>( | 695 ScheduleInFlightChange(base::MakeUnique<InFlightBoundsChange>( |
696 this, window, old_bounds, window->GetLocalSurfaceId())); | 696 this, window, old_bounds, window->GetLocalSurfaceId())); |
697 base::Optional<cc::LocalSurfaceId> local_surface_id; | 697 base::Optional<cc::LocalSurfaceId> local_surface_id; |
698 if (window->window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || | 698 if (window->window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM || |
699 window->window_mus_type() == WindowMusType::EMBED_IN_OWNER || | 699 window->window_mus_type() == WindowMusType::EMBED_IN_OWNER || |
700 window->window_mus_type() == WindowMusType::DISPLAY_MANUALLY_CREATED) { | 700 window->window_mus_type() == WindowMusType::DISPLAY_MANUALLY_CREATED) { |
701 local_surface_id = window->GetOrAllocateLocalSurfaceId(new_bounds.size()); | 701 local_surface_id = window->GetOrAllocateLocalSurfaceId(new_bounds.size()); |
702 synchronizing_with_child_on_next_frame_ = true; | 702 synchronizing_with_child_on_next_frame_ = true; |
703 } else if (window->window_mus_type() == WindowMusType::LOCAL) { | |
Fady Samuel
2017/06/07 20:36:11
if it has a CompositorFrameSink then do this...
Peng
2017/06/07 21:14:29
Done.
| |
704 auto id = window->GetOrAllocateLocalSurfaceId(new_bounds.size()); | |
705 if (id.is_valid()) { | |
706 local_surface_id = id; | |
707 synchronizing_with_child_on_next_frame_ = true; | |
708 } | |
703 } | 709 } |
704 tree_->SetWindowBounds(change_id, window->server_id(), new_bounds, | 710 tree_->SetWindowBounds(change_id, window->server_id(), new_bounds, |
705 local_surface_id); | 711 local_surface_id); |
706 } | 712 } |
707 | 713 |
708 void WindowTreeClient::OnWindowMusCreated(WindowMus* window) { | 714 void WindowTreeClient::OnWindowMusCreated(WindowMus* window) { |
709 if (window->server_id() != kInvalidServerId) | 715 if (window->server_id() != kInvalidServerId) |
710 return; | 716 return; |
711 | 717 |
712 window->set_server_id(MakeTransportId(client_id_, next_window_id_++)); | 718 window->set_server_id(MakeTransportId(client_id_, next_window_id_++)); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1405 | 1411 |
1406 window->SetCursorFromServer(cursor); | 1412 window->SetCursorFromServer(cursor); |
1407 } | 1413 } |
1408 | 1414 |
1409 void WindowTreeClient::OnWindowSurfaceChanged( | 1415 void WindowTreeClient::OnWindowSurfaceChanged( |
1410 Id window_id, | 1416 Id window_id, |
1411 const cc::SurfaceInfo& surface_info) { | 1417 const cc::SurfaceInfo& surface_info) { |
1412 WindowMus* window = GetWindowByServerId(window_id); | 1418 WindowMus* window = GetWindowByServerId(window_id); |
1413 if (!window) | 1419 if (!window) |
1414 return; | 1420 return; |
1415 | |
1416 // If the parent is informed of a child's surface then that surface ID is | |
1417 // guaranteed to be available in the display compositor so we set it as the | |
1418 // fallback. If surface synchronization is enabled, the primary SurfaceInfo | |
1419 // is created by the embedder, and the LocalSurfaceId is allocated by the | |
1420 // embedder. | |
1421 window->SetFallbackSurfaceInfo(surface_info); | 1421 window->SetFallbackSurfaceInfo(surface_info); |
1422 } | 1422 } |
1423 | 1423 |
1424 void WindowTreeClient::OnDragDropStart( | 1424 void WindowTreeClient::OnDragDropStart( |
1425 const std::unordered_map<std::string, std::vector<uint8_t>>& mime_data) { | 1425 const std::unordered_map<std::string, std::vector<uint8_t>>& mime_data) { |
1426 drag_drop_controller_->OnDragDropStart(mojo::UnorderedMapToMap(mime_data)); | 1426 drag_drop_controller_->OnDragDropStart(mojo::UnorderedMapToMap(mime_data)); |
1427 } | 1427 } |
1428 | 1428 |
1429 void WindowTreeClient::OnDragEnter(Id window_id, | 1429 void WindowTreeClient::OnDragEnter(Id window_id, |
1430 uint32_t key_state, | 1430 uint32_t key_state, |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2140 } | 2140 } |
2141 | 2141 |
2142 void WindowTreeClient::OnCompositingLockStateChanged( | 2142 void WindowTreeClient::OnCompositingLockStateChanged( |
2143 ui::Compositor* compositor) {} | 2143 ui::Compositor* compositor) {} |
2144 | 2144 |
2145 void WindowTreeClient::OnCompositingShuttingDown(ui::Compositor* compositor) { | 2145 void WindowTreeClient::OnCompositingShuttingDown(ui::Compositor* compositor) { |
2146 compositor->RemoveObserver(this); | 2146 compositor->RemoveObserver(this); |
2147 } | 2147 } |
2148 | 2148 |
2149 } // namespace aura | 2149 } // namespace aura |
OLD | NEW |