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

Side by Side Diff: ui/aura/mus/window_port_mus.cc

Issue 2464123003: Enabling Aura-Mus clients to submit frames to Mus. (Closed)
Patch Set: Rebase, addressing feedback, removing some unneded imports/deps. Created 4 years, 1 month 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
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_host_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/aura/mus/window_port_mus.h" 5 #include "ui/aura/mus/window_port_mus.h"
6 6
7 #include "ui/aura/client/aura_constants.h" 7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/aura/client/transient_window_client.h" 8 #include "ui/aura/client/transient_window_client.h"
9 #include "ui/aura/mus/property_converter.h" 9 #include "ui/aura/mus/property_converter.h"
10 #include "ui/aura/mus/surface_id_handler.h" 10 #include "ui/aura/mus/surface_id_handler.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void WindowPortMus::SetImeVisibility(bool visible, 48 void WindowPortMus::SetImeVisibility(bool visible,
49 mojo::TextInputStatePtr state) { 49 mojo::TextInputStatePtr state) {
50 window_tree_client_->SetImeVisibility(this, visible, std::move(state)); 50 window_tree_client_->SetImeVisibility(this, visible, std::move(state));
51 } 51 }
52 52
53 void WindowPortMus::SetPredefinedCursor(ui::mojom::Cursor cursor_id) { 53 void WindowPortMus::SetPredefinedCursor(ui::mojom::Cursor cursor_id) {
54 window_tree_client_->SetPredefinedCursor(this, predefined_cursor_, cursor_id); 54 window_tree_client_->SetPredefinedCursor(this, predefined_cursor_, cursor_id);
55 predefined_cursor_ = cursor_id; 55 predefined_cursor_ = cursor_id;
56 } 56 }
57 57
58 std::unique_ptr<WindowCompositorFrameSink>
59 WindowPortMus::RequestCompositorFrameSink(
60 ui::mojom::CompositorFrameSinkType type,
61 scoped_refptr<cc::ContextProvider> context_provider,
62 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
63 std::unique_ptr<WindowCompositorFrameSinkBinding>
64 compositor_frame_sink_binding;
65 std::unique_ptr<WindowCompositorFrameSink> compositor_frame_sink =
66 WindowCompositorFrameSink::Create(std::move(context_provider),
67 gpu_memory_buffer_manager,
68 &compositor_frame_sink_binding);
69 AttachCompositorFrameSink(type, std::move(compositor_frame_sink_binding));
70 return compositor_frame_sink;
71 }
72
73 void WindowPortMus::AttachCompositorFrameSink(
74 ui::mojom::CompositorFrameSinkType type,
75 std::unique_ptr<WindowCompositorFrameSinkBinding>
76 compositor_frame_sink_binding) {
77 window_tree_client_->AttachCompositorFrameSink(
78 server_id(), type,
79 std::move(compositor_frame_sink_binding->compositor_frame_sink_request_),
80 mojo::MakeProxy(std::move(
81 compositor_frame_sink_binding->compositor_frame_sink_client_)));
82 }
83
58 WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange( 84 WindowPortMus::ServerChangeIdType WindowPortMus::ScheduleChange(
59 const ServerChangeType type, 85 const ServerChangeType type,
60 const ServerChangeData& data) { 86 const ServerChangeData& data) {
61 ServerChange change; 87 ServerChange change;
62 change.type = type; 88 change.type = type;
63 change.server_change_id = next_server_change_id_++; 89 change.server_change_id = next_server_change_id_++;
64 change.data = data; 90 change.data = data;
65 server_changes_.push_back(change); 91 server_changes_.push_back(change);
66 return change.server_change_id; 92 return change.server_change_id;
67 } 93 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 change_data.property_name = 356 change_data.property_name =
331 GetPropertyConverter()->GetTransportNameForPropertyKey(key); 357 GetPropertyConverter()->GetTransportNameForPropertyKey(key);
332 // TODO(sky): investigate to see if we need to compare data. In particular do 358 // TODO(sky): investigate to see if we need to compare data. In particular do
333 // we ever have a case where changing a property cascades into changing the 359 // we ever have a case where changing a property cascades into changing the
334 // same property? 360 // same property?
335 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) 361 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data))
336 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); 362 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data));
337 } 363 }
338 364
339 } // namespace aura 365 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_host_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698