| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/ws/server_window_surface_manager.h" | 5 #include "components/mus/ws/server_window_surface_manager.h" |
| 6 | 6 |
| 7 #include "components/mus/surfaces/surfaces_state.h" | 7 #include "components/mus/surfaces/surfaces_state.h" |
| 8 #include "components/mus/ws/server_window.h" | 8 #include "components/mus/ws/server_window.h" |
| 9 #include "components/mus/ws/server_window_delegate.h" | 9 #include "components/mus/ws/server_window_delegate.h" |
| 10 #include "components/mus/ws/server_window_surface.h" | 10 #include "components/mus/ws/server_window_surface.h" |
| 11 | 11 |
| 12 namespace mus { | 12 namespace mus { |
| 13 namespace ws { | 13 namespace ws { |
| 14 | 14 |
| 15 ServerWindowSurfaceManager::ServerWindowSurfaceManager(ServerWindow* window) | 15 ServerWindowSurfaceManager::ServerWindowSurfaceManager(ServerWindow* window) |
| 16 : window_(window), | 16 : window_(window), |
| 17 surface_id_allocator_(WindowIdToTransportId(window->id())), | 17 surface_id_allocator_( |
| 18 window->delegate()->GetSurfacesState()->next_id_namespace()), |
| 18 waiting_for_initial_frames_( | 19 waiting_for_initial_frames_( |
| 19 window_->properties().count(mus::mojom::kWaitForUnderlay_Property) > | 20 window_->properties().count(mus::mojom::kWaitForUnderlay_Property) > |
| 20 0) { | 21 0) { |
| 21 surface_id_allocator_.RegisterSurfaceIdNamespace(GetSurfaceManager()); | 22 surface_id_allocator_.RegisterSurfaceIdNamespace(GetSurfaceManager()); |
| 22 } | 23 } |
| 23 | 24 |
| 24 ServerWindowSurfaceManager::~ServerWindowSurfaceManager() { | 25 ServerWindowSurfaceManager::~ServerWindowSurfaceManager() { |
| 25 // Explicitly clear the type to surface manager so that this manager | 26 // Explicitly clear the type to surface manager so that this manager |
| 26 // is still valid prior during ~ServerWindowSurface. | 27 // is still valid prior during ~ServerWindowSurface. |
| 27 type_to_surface_map_.clear(); | 28 type_to_surface_map_.clear(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return last_submitted_frame_size.width() >= window_->bounds().width() && | 93 return last_submitted_frame_size.width() >= window_->bounds().width() && |
| 93 last_submitted_frame_size.height() >= window_->bounds().height(); | 94 last_submitted_frame_size.height() >= window_->bounds().height(); |
| 94 } | 95 } |
| 95 | 96 |
| 96 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { | 97 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { |
| 97 return surface_id_allocator_.GenerateId(); | 98 return surface_id_allocator_.GenerateId(); |
| 98 } | 99 } |
| 99 | 100 |
| 100 } // namespace ws | 101 } // namespace ws |
| 101 } // namespace mus | 102 } // namespace mus |
| OLD | NEW |