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

Side by Side Diff: mojo/services/view_manager/window_tree_host_impl.cc

Issue 510553002: Teach the native viewport service to draw a Surface into itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « mojo/services/public/interfaces/surfaces/surfaces.mojom ('k') | mojo/shell/context.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/public/c/gles2/gles2.h" 5 #include "mojo/public/c/gles2/gles2.h"
6 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" 6 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
7 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" 7 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
8 #include "mojo/services/view_manager/connection_manager.h" 8 #include "mojo/services/view_manager/connection_manager.h"
9 #include "mojo/services/view_manager/context_factory_impl.h" 9 #include "mojo/services/view_manager/context_factory_impl.h"
10 #include "mojo/services/view_manager/window_tree_host_impl.h" 10 #include "mojo/services/view_manager/window_tree_host_impl.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 ui::EventProcessor* WindowTreeHostImpl::GetEventProcessor() { 156 ui::EventProcessor* WindowTreeHostImpl::GetEventProcessor() {
157 return dispatcher(); 157 return dispatcher();
158 } 158 }
159 159
160 //////////////////////////////////////////////////////////////////////////////// 160 ////////////////////////////////////////////////////////////////////////////////
161 // WindowTreeHostImpl, NativeViewportClient implementation: 161 // WindowTreeHostImpl, NativeViewportClient implementation:
162 162
163 void WindowTreeHostImpl::OnCreated(uint64_t native_viewport_id) { 163 void WindowTreeHostImpl::OnCreated(uint64_t native_viewport_id) {
164 CommandBufferPtr cb; 164 CommandBufferPtr cb;
165 // TODO(jamesr): Output to a surface instead.
165 gpu_service_->CreateOnscreenGLES2Context( 166 gpu_service_->CreateOnscreenGLES2Context(
166 native_viewport_id, Size::From(bounds_.size()), Get(&cb)); 167 native_viewport_id, Size::From(bounds_.size()), Get(&cb));
167 widget_ = bit_cast<gfx::AcceleratedWidget>( 168 widget_ = bit_cast<gfx::AcceleratedWidget>(
168 static_cast<uintptr_t>(native_viewport_id)); 169 static_cast<uintptr_t>(native_viewport_id));
169 170
170 // The ContextFactory must exist before any Compositors are created. 171 // The ContextFactory must exist before any Compositors are created.
171 if (context_factory_) { 172 if (context_factory_) {
172 delete context_factory_; 173 delete context_factory_;
173 context_factory_ = NULL; 174 context_factory_ = NULL;
174 } 175 }
(...skipping 17 matching lines...) Expand all
192 } 193 }
193 194
194 void WindowTreeHostImpl::OnEvent(EventPtr event, 195 void WindowTreeHostImpl::OnEvent(EventPtr event,
195 const mojo::Callback<void()>& callback) { 196 const mojo::Callback<void()>& callback) {
196 event_received_callback_.Run(event.Pass()); 197 event_received_callback_.Run(event.Pass());
197 callback.Run(); 198 callback.Run();
198 }; 199 };
199 200
200 } // namespace service 201 } // namespace service
201 } // namespace mojo 202 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/public/interfaces/surfaces/surfaces.mojom ('k') | mojo/shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698