| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 void WindowTree::SetWindowOpacity(uint32_t change_id, | 1347 void WindowTree::SetWindowOpacity(uint32_t change_id, |
| 1348 Id window_id, | 1348 Id window_id, |
| 1349 float opacity) { | 1349 float opacity) { |
| 1350 client()->OnChangeCompleted( | 1350 client()->OnChangeCompleted( |
| 1351 change_id, SetWindowOpacity(ClientWindowId(window_id), opacity)); | 1351 change_id, SetWindowOpacity(ClientWindowId(window_id), opacity)); |
| 1352 } | 1352 } |
| 1353 | 1353 |
| 1354 void WindowTree::AttachCompositorFrameSink( | 1354 void WindowTree::AttachCompositorFrameSink( |
| 1355 Id transport_window_id, | 1355 Id transport_window_id, |
| 1356 mojom::CompositorFrameSinkType type, | 1356 mojom::CompositorFrameSinkType type, |
| 1357 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> surface, | 1357 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, |
| 1358 cc::mojom::MojoCompositorFrameSinkClientPtr client) { | 1358 cc::mojom::MojoCompositorFrameSinkClientPtr client) { |
| 1359 ServerWindow* window = | 1359 ServerWindow* window = |
| 1360 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1360 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1361 const bool success = | 1361 const bool success = |
| 1362 window && access_policy_->CanSetWindowCompositorFrameSink(window, type); | 1362 window && access_policy_->CanSetWindowCompositorFrameSink(window, type); |
| 1363 if (!success) { | 1363 if (!success) { |
| 1364 DVLOG(1) << "request to AttachCompositorFrameSink failed"; | 1364 DVLOG(1) << "request to AttachCompositorFrameSink failed"; |
| 1365 return; | 1365 return; |
| 1366 } | 1366 } |
| 1367 window->CreateCompositorFrameSink(type, std::move(surface), | 1367 window->CreateCompositorFrameSink(type, gfx::kNullAcceleratedWidget, nullptr, |
| 1368 nullptr, std::move(compositor_frame_sink), |
| 1368 std::move(client)); | 1369 std::move(client)); |
| 1369 } | 1370 } |
| 1370 | 1371 |
| 1371 void WindowTree::OnWindowSurfaceDetached(Id transport_window_id, | 1372 void WindowTree::OnWindowSurfaceDetached(Id transport_window_id, |
| 1372 const cc::SurfaceSequence& sequence) { | 1373 const cc::SurfaceSequence& sequence) { |
| 1373 ServerWindow* window = | 1374 ServerWindow* window = |
| 1374 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1375 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1375 if (!window) | 1376 if (!window) |
| 1376 return; | 1377 return; |
| 1377 window_server_->GetDisplayCompositor()->ReturnSurfaceReference(sequence); | 1378 window_server_->GetDisplayCompositor()->ReturnSurfaceReference(sequence); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 1945 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 1945 effect_bitmask, callback); | 1946 effect_bitmask, callback); |
| 1946 } | 1947 } |
| 1947 | 1948 |
| 1948 void WindowTree::PerformOnDragDropDone() { | 1949 void WindowTree::PerformOnDragDropDone() { |
| 1949 client()->OnDragDropDone(); | 1950 client()->OnDragDropDone(); |
| 1950 } | 1951 } |
| 1951 | 1952 |
| 1952 } // namespace ws | 1953 } // namespace ws |
| 1953 } // namespace ui | 1954 } // namespace ui |
| OLD | NEW |