| 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/display_compositor.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 waiting_for_initial_frames_( | 17 waiting_for_initial_frames_( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool ServerWindowSurfaceManager::HasSurfaceOfType( | 61 bool ServerWindowSurfaceManager::HasSurfaceOfType( |
| 62 mojom::SurfaceType type) const { | 62 mojom::SurfaceType type) const { |
| 63 return type_to_surface_map_.count(type) > 0; | 63 return type_to_surface_map_.count(type) > 0; |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool ServerWindowSurfaceManager::HasAnySurface() const { | 66 bool ServerWindowSurfaceManager::HasAnySurface() const { |
| 67 return GetDefaultSurface() || GetUnderlaySurface(); | 67 return GetDefaultSurface() || GetUnderlaySurface(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 cc::SurfaceManager* ServerWindowSurfaceManager::GetSurfaceManager() { | 70 cc::SurfaceManager* ServerWindowSurfaceManager::GetSurfaceManager() { |
| 71 return window()->delegate()->GetSurfacesState()->manager(); | 71 return window()->delegate()->GetDisplayCompositor()->manager(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool ServerWindowSurfaceManager::IsSurfaceReadyAndNonEmpty( | 74 bool ServerWindowSurfaceManager::IsSurfaceReadyAndNonEmpty( |
| 75 mojom::SurfaceType type) const { | 75 mojom::SurfaceType type) const { |
| 76 auto iter = type_to_surface_map_.find(type); | 76 auto iter = type_to_surface_map_.find(type); |
| 77 if (iter == type_to_surface_map_.end()) | 77 if (iter == type_to_surface_map_.end()) |
| 78 return false; | 78 return false; |
| 79 if (iter->second->last_submitted_frame_size().IsEmpty()) | 79 if (iter->second->last_submitted_frame_size().IsEmpty()) |
| 80 return false; | 80 return false; |
| 81 const gfx::Size& last_submitted_frame_size = | 81 const gfx::Size& last_submitted_frame_size = |
| 82 iter->second->last_submitted_frame_size(); | 82 iter->second->last_submitted_frame_size(); |
| 83 return last_submitted_frame_size.width() >= window_->bounds().width() && | 83 return last_submitted_frame_size.width() >= window_->bounds().width() && |
| 84 last_submitted_frame_size.height() >= window_->bounds().height(); | 84 last_submitted_frame_size.height() >= window_->bounds().height(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace ws | 87 } // namespace ws |
| 88 } // namespace ui | 88 } // namespace ui |
| OLD | NEW |