| 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 "services/ui/ws/server_window_surface_manager.h" | 5 #include "services/ui/ws/server_window_surface_manager.h" |
| 6 | 6 |
| 7 #include "services/ui/surfaces/surfaces_state.h" | 7 #include "services/ui/surfaces/surfaces_state.h" |
| 8 #include "services/ui/ws/server_window.h" | 8 #include "services/ui/ws/server_window.h" |
| 9 #include "services/ui/ws/server_window_delegate.h" | 9 #include "services/ui/ws/server_window_delegate.h" |
| 10 #include "services/ui/ws/server_window_surface.h" | 10 #include "services/ui/ws/server_window_surface.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 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_( | 17 surface_id_allocator_( |
| 18 window->delegate()->GetSurfacesState()->next_id_namespace()), | 18 window->delegate()->GetSurfacesState()->next_client_id()), |
| 19 waiting_for_initial_frames_( | 19 waiting_for_initial_frames_( |
| 20 window_->properties().count(ui::mojom::kWaitForUnderlay_Property) > | 20 window_->properties().count(ui::mojom::kWaitForUnderlay_Property) > |
| 21 0) { | 21 0) { |
| 22 surface_id_allocator_.RegisterSurfaceIdNamespace(GetSurfaceManager()); | 22 surface_id_allocator_.RegisterSurfaceClientId(GetSurfaceManager()); |
| 23 } | 23 } |
| 24 | 24 |
| 25 ServerWindowSurfaceManager::~ServerWindowSurfaceManager() { | 25 ServerWindowSurfaceManager::~ServerWindowSurfaceManager() { |
| 26 // Explicitly clear the type to surface manager so that this manager | 26 // Explicitly clear the type to surface manager so that this manager |
| 27 // is still valid prior during ~ServerWindowSurface. | 27 // is still valid prior during ~ServerWindowSurface. |
| 28 type_to_surface_map_.clear(); | 28 type_to_surface_map_.clear(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool ServerWindowSurfaceManager::ShouldDraw() { | 31 bool ServerWindowSurfaceManager::ShouldDraw() { |
| 32 if (!waiting_for_initial_frames_) | 32 if (!waiting_for_initial_frames_) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return last_submitted_frame_size.width() >= window_->bounds().width() && | 93 return last_submitted_frame_size.width() >= window_->bounds().width() && |
| 94 last_submitted_frame_size.height() >= window_->bounds().height(); | 94 last_submitted_frame_size.height() >= window_->bounds().height(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { | 97 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { |
| 98 return surface_id_allocator_.GenerateId(); | 98 return surface_id_allocator_.GenerateId(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace ws | 101 } // namespace ws |
| 102 } // namespace ui | 102 } // namespace ui |
| OLD | NEW |