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/display_compositor.h" | 7 #include "services/ui/surfaces/display_compositor.h" |
8 #include "services/ui/ws/ids.h" | 8 #include "services/ui/ws/ids.h" |
9 #include "services/ui/ws/server_window.h" | 9 #include "services/ui/ws/server_window.h" |
10 #include "services/ui/ws/server_window_delegate.h" | 10 #include "services/ui/ws/server_window_delegate.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 return true; | 31 return true; |
32 | 32 |
33 waiting_for_initial_frames_ = | 33 waiting_for_initial_frames_ = |
34 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::DEFAULT) || | 34 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::DEFAULT) || |
35 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::UNDERLAY); | 35 !IsSurfaceReadyAndNonEmpty(mojom::SurfaceType::UNDERLAY); |
36 return !waiting_for_initial_frames_; | 36 return !waiting_for_initial_frames_; |
37 } | 37 } |
38 | 38 |
39 void ServerWindowSurfaceManager::CreateSurface( | 39 void ServerWindowSurfaceManager::CreateSurface( |
40 mojom::SurfaceType surface_type, | 40 mojom::SurfaceType surface_type, |
41 mojo::InterfaceRequest<mojom::Surface> request, | 41 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> request, |
42 mojom::SurfaceClientPtr client) { | 42 cc::mojom::MojoCompositorFrameSinkClientPtr client) { |
43 cc::FrameSinkId frame_sink_id(WindowIdToTransportId(window_->id()), | 43 cc::FrameSinkId frame_sink_id(WindowIdToTransportId(window_->id()), |
44 static_cast<uint32_t>(surface_type)); | 44 static_cast<uint32_t>(surface_type)); |
45 std::unique_ptr<ServerWindowSurface> surface(new ServerWindowSurface( | 45 std::unique_ptr<ServerWindowSurface> surface(new ServerWindowSurface( |
46 this, frame_sink_id, std::move(request), std::move(client))); | 46 this, frame_sink_id, std::move(request), std::move(client))); |
47 type_to_surface_map_[surface_type] = std::move(surface); | 47 type_to_surface_map_[surface_type] = std::move(surface); |
48 } | 48 } |
49 | 49 |
50 ServerWindowSurface* ServerWindowSurfaceManager::GetDefaultSurface() const { | 50 ServerWindowSurface* ServerWindowSurfaceManager::GetDefaultSurface() const { |
51 return GetSurfaceByType(mojom::SurfaceType::DEFAULT); | 51 return GetSurfaceByType(mojom::SurfaceType::DEFAULT); |
52 } | 52 } |
(...skipping 29 matching lines...) Expand all Loading... |
82 if (iter->second->last_submitted_frame_size().IsEmpty()) | 82 if (iter->second->last_submitted_frame_size().IsEmpty()) |
83 return false; | 83 return false; |
84 const gfx::Size& last_submitted_frame_size = | 84 const gfx::Size& last_submitted_frame_size = |
85 iter->second->last_submitted_frame_size(); | 85 iter->second->last_submitted_frame_size(); |
86 return last_submitted_frame_size.width() >= window_->bounds().width() && | 86 return last_submitted_frame_size.width() >= window_->bounds().width() && |
87 last_submitted_frame_size.height() >= window_->bounds().height(); | 87 last_submitted_frame_size.height() >= window_->bounds().height(); |
88 } | 88 } |
89 | 89 |
90 } // namespace ws | 90 } // namespace ws |
91 } // namespace ui | 91 } // namespace ui |
OLD | NEW |