| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/window_server_test_impl.h" | 5 #include "services/ui/ws/window_server_test_impl.h" |
| 6 | 6 |
| 7 #include "services/ui/public/interfaces/window_tree.mojom.h" | 7 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 8 #include "services/ui/ws/server_window.h" | 8 #include "services/ui/ws/server_window.h" |
| 9 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" | 9 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" |
| 10 #include "services/ui/ws/window_server.h" | 10 #include "services/ui/ws/window_server.h" |
| 11 #include "services/ui/ws/window_tree.h" | 11 #include "services/ui/ws/window_tree.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 namespace ws { | 14 namespace ws { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 bool WindowHasValidFrame(const ServerWindow* window) { | 18 bool WindowHasValidFrame(const ServerWindow* window) { |
| 19 const ServerWindowCompositorFrameSinkManager* manager = | 19 const ServerWindowCompositorFrameSinkManager* manager = |
| 20 window->compositor_frame_sink_manager(); | 20 window->compositor_frame_sink_manager(); |
| 21 return manager && | 21 return manager && |
| 22 !manager->GetDefaultCompositorFrameSink() | 22 !manager->GetLatestFrameSize(mojom::CompositorFrameSinkType::DEFAULT) |
| 23 ->last_submitted_frame_size() | |
| 24 .IsEmpty(); | 23 .IsEmpty(); |
| 25 } | 24 } |
| 26 | 25 |
| 27 } // namespace | 26 } // namespace |
| 28 | 27 |
| 29 WindowServerTestImpl::WindowServerTestImpl(WindowServer* window_server) | 28 WindowServerTestImpl::WindowServerTestImpl(WindowServer* window_server) |
| 30 : window_server_(window_server) {} | 29 : window_server_(window_server) {} |
| 31 | 30 |
| 32 WindowServerTestImpl::~WindowServerTestImpl() {} | 31 WindowServerTestImpl::~WindowServerTestImpl() {} |
| 33 | 32 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 58 } | 57 } |
| 59 } | 58 } |
| 60 | 59 |
| 61 window_server_->SetPaintCallback( | 60 window_server_->SetPaintCallback( |
| 62 base::Bind(&WindowServerTestImpl::OnWindowPaint, base::Unretained(this), | 61 base::Bind(&WindowServerTestImpl::OnWindowPaint, base::Unretained(this), |
| 63 name, std::move(callback))); | 62 name, std::move(callback))); |
| 64 } | 63 } |
| 65 | 64 |
| 66 } // namespace ws | 65 } // namespace ws |
| 67 } // namespace ui | 66 } // namespace ui |
| OLD | NEW |