Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2429173005: Mus+Ash: Replace (Server)WindowSurface with (Server)WindowCompositorFrameSink (Closed)
Patch Set: ui::CompositorFrameSink => ui::WindowCompositorFrameSink Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "services/ui/ws/default_access_policy.h" 14 #include "services/ui/ws/default_access_policy.h"
15 #include "services/ui/ws/display.h" 15 #include "services/ui/ws/display.h"
16 #include "services/ui/ws/display_manager.h" 16 #include "services/ui/ws/display_manager.h"
17 #include "services/ui/ws/event_matcher.h" 17 #include "services/ui/ws/event_matcher.h"
18 #include "services/ui/ws/focus_controller.h" 18 #include "services/ui/ws/focus_controller.h"
19 #include "services/ui/ws/operation.h" 19 #include "services/ui/ws/operation.h"
20 #include "services/ui/ws/platform_display.h" 20 #include "services/ui/ws/platform_display.h"
21 #include "services/ui/ws/server_window.h" 21 #include "services/ui/ws/server_window.h"
22 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
22 #include "services/ui/ws/server_window_observer.h" 23 #include "services/ui/ws/server_window_observer.h"
23 #include "services/ui/ws/server_window_surface_manager.h"
24 #include "services/ui/ws/user_display_manager.h" 24 #include "services/ui/ws/user_display_manager.h"
25 #include "services/ui/ws/window_manager_display_root.h" 25 #include "services/ui/ws/window_manager_display_root.h"
26 #include "services/ui/ws/window_manager_state.h" 26 #include "services/ui/ws/window_manager_state.h"
27 #include "services/ui/ws/window_server.h" 27 #include "services/ui/ws/window_server.h"
28 #include "services/ui/ws/window_tree_binding.h" 28 #include "services/ui/ws/window_tree_binding.h"
29 #include "ui/display/display.h" 29 #include "ui/display/display.h"
30 #include "ui/platform_window/mojo/ime_type_converters.h" 30 #include "ui/platform_window/mojo/ime_type_converters.h"
31 #include "ui/platform_window/text_input_state.h" 31 #include "ui/platform_window/text_input_state.h"
32 32
33 using mojo::Array; 33 using mojo::Array;
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 const gfx::Size& frame_size, 762 const gfx::Size& frame_size,
763 float device_scale_factor) { 763 float device_scale_factor) {
764 ServerWindow* parent_window = window->parent(); 764 ServerWindow* parent_window = window->parent();
765 ClientWindowId client_window_id, parent_client_window_id; 765 ClientWindowId client_window_id, parent_client_window_id;
766 if (!IsWindowKnown(window, &client_window_id) || 766 if (!IsWindowKnown(window, &client_window_id) ||
767 !IsWindowKnown(parent_window, &parent_client_window_id) || 767 !IsWindowKnown(parent_window, &parent_client_window_id) ||
768 !created_window_map_.count(parent_window->id())) { 768 !created_window_map_.count(parent_window->id())) {
769 return; 769 return;
770 } 770 }
771 771
772 ServerWindowSurfaceManager* surface_manager = 772 ServerWindowCompositorFrameSinkManager* compositor_frame_sink_manager =
773 window->GetOrCreateSurfaceManager(); 773 window->GetOrCreateCompositorFrameSinkManager();
774 ServerWindowSurface* surface = surface_manager->GetDefaultSurface(); 774 ServerWindowCompositorFrameSink* compositor_frame_sink =
775 cc::SurfaceSequence sequence = surface->CreateSurfaceSequence(); 775 compositor_frame_sink_manager->GetDefaultCompositorFrameSink();
776 cc::SurfaceSequence sequence = compositor_frame_sink->CreateSurfaceSequence();
776 client()->OnWindowSurfaceChanged(client_window_id.id, surface_id, sequence, 777 client()->OnWindowSurfaceChanged(client_window_id.id, surface_id, sequence,
777 frame_size, device_scale_factor); 778 frame_size, device_scale_factor);
778 } 779 }
779 780
780 void WindowTree::SendToPointerWatcher(const ui::Event& event, 781 void WindowTree::SendToPointerWatcher(const ui::Event& event,
781 ServerWindow* target_window) { 782 ServerWindow* target_window) {
782 if (!EventMatchesPointerWatcher(event)) 783 if (!EventMatchesPointerWatcher(event))
783 return; 784 return;
784 785
785 ClientWindowId client_window_id; 786 ClientWindowId client_window_id;
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 client()->OnChangeCompleted(change_id, success); 1339 client()->OnChangeCompleted(change_id, success);
1339 } 1340 }
1340 1341
1341 void WindowTree::SetWindowOpacity(uint32_t change_id, 1342 void WindowTree::SetWindowOpacity(uint32_t change_id,
1342 Id window_id, 1343 Id window_id,
1343 float opacity) { 1344 float opacity) {
1344 client()->OnChangeCompleted( 1345 client()->OnChangeCompleted(
1345 change_id, SetWindowOpacity(ClientWindowId(window_id), opacity)); 1346 change_id, SetWindowOpacity(ClientWindowId(window_id), opacity));
1346 } 1347 }
1347 1348
1348 void WindowTree::AttachSurface( 1349 void WindowTree::AttachCompositorFrameSink(
1349 Id transport_window_id, 1350 Id transport_window_id,
1350 mojom::SurfaceType type, 1351 mojom::CompositorFrameSinkType type,
1351 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> surface, 1352 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> surface,
1352 cc::mojom::MojoCompositorFrameSinkClientPtr client) { 1353 cc::mojom::MojoCompositorFrameSinkClientPtr client) {
1353 ServerWindow* window = 1354 ServerWindow* window =
1354 GetWindowByClientId(ClientWindowId(transport_window_id)); 1355 GetWindowByClientId(ClientWindowId(transport_window_id));
1355 const bool success = 1356 const bool success =
1356 window && access_policy_->CanSetWindowSurface(window, type); 1357 window && access_policy_->CanSetWindowCompositorFrameSink(window, type);
1357 if (!success) { 1358 if (!success) {
1358 DVLOG(1) << "request to AttachSurface failed"; 1359 DVLOG(1) << "request to AttachCompositorFrameSink failed";
1359 return; 1360 return;
1360 } 1361 }
1361 window->CreateSurface(type, std::move(surface), std::move(client)); 1362 window->CreateCompositorFrameSink(type, std::move(surface),
1363 std::move(client));
1362 } 1364 }
1363 1365
1364 void WindowTree::OnWindowSurfaceDetached(Id transport_window_id, 1366 void WindowTree::OnWindowSurfaceDetached(Id transport_window_id,
1365 const cc::SurfaceSequence& sequence) { 1367 const cc::SurfaceSequence& sequence) {
1366 ServerWindow* window = 1368 ServerWindow* window =
1367 GetWindowByClientId(ClientWindowId(transport_window_id)); 1369 GetWindowByClientId(ClientWindowId(transport_window_id));
1368 if (!window) 1370 if (!window)
1369 return; 1371 return;
1370 window_server_->GetDisplayCompositor()->ReturnSurfaceReference(sequence); 1372 window_server_->GetDisplayCompositor()->ReturnSurfaceReference(sequence);
1371 } 1373 }
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 1939 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
1938 effect_bitmask, callback); 1940 effect_bitmask, callback);
1939 } 1941 }
1940 1942
1941 void WindowTree::PerformOnDragDropDone() { 1943 void WindowTree::PerformOnDragDropDone() {
1942 client()->OnDragDropDone(); 1944 client()->OnDragDropDone();
1943 } 1945 }
1944 1946
1945 } // namespace ws 1947 } // namespace ws
1946 } // namespace ui 1948 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698