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/ws/server_window.h" | 7 #include "components/mus/ws/server_window.h" |
8 #include "components/mus/ws/server_window_delegate.h" | 8 #include "components/mus/ws/server_window_delegate.h" |
9 #include "components/mus/ws/server_window_surface.h" | 9 #include "components/mus/ws/server_window_surface.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 ServerWindowSurface* ServerWindowSurfaceManager::GetUnderlaySurface() { | 32 ServerWindowSurface* ServerWindowSurfaceManager::GetUnderlaySurface() { |
33 return GetSurfaceByType(mojom::SURFACE_TYPE_UNDERLAY); | 33 return GetSurfaceByType(mojom::SURFACE_TYPE_UNDERLAY); |
34 } | 34 } |
35 | 35 |
36 ServerWindowSurface* ServerWindowSurfaceManager::GetSurfaceByType( | 36 ServerWindowSurface* ServerWindowSurfaceManager::GetSurfaceByType( |
37 mojom::SurfaceType type) { | 37 mojom::SurfaceType type) { |
38 auto iter = type_to_surface_map_.find(type); | 38 auto iter = type_to_surface_map_.find(type); |
39 return iter == type_to_surface_map_.end() ? nullptr : iter->second.get(); | 39 return iter == type_to_surface_map_.end() ? nullptr : iter->second.get(); |
40 } | 40 } |
41 | 41 |
| 42 bool ServerWindowSurfaceManager::HasSurfaceOfType(mojom::SurfaceType type) { |
| 43 return type_to_surface_map_.count(type) > 0; |
| 44 } |
| 45 |
42 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { | 46 cc::SurfaceId ServerWindowSurfaceManager::GenerateId() { |
43 return surface_id_allocator_.GenerateId(); | 47 return surface_id_allocator_.GenerateId(); |
44 } | 48 } |
45 | 49 |
46 } // namespace ws | 50 } // namespace ws |
47 } // namespace mus | 51 } // namespace mus |
OLD | NEW |