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

Side by Side Diff: mojo/aura/window_tree_host_mojo.cc

Issue 272323003: Mojo: Implement support for |Foo&| mojom syntax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/aura/context_factory_mojo.cc ('k') | mojo/cc/context_provider_mojo.h » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/aura/window_tree_host_mojo.h" 5 #include "mojo/aura/window_tree_host_mojo.h"
6 6
7 #include "mojo/aura/context_factory_mojo.h" 7 #include "mojo/aura/context_factory_mojo.h"
8 #include "mojo/public/c/gles2/gles2.h" 8 #include "mojo/public/c/gles2/gles2.h"
9 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" 9 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 16 matching lines...) Expand all
27 WindowTreeHostMojo::WindowTreeHostMojo( 27 WindowTreeHostMojo::WindowTreeHostMojo(
28 NativeViewportPtr viewport, 28 NativeViewportPtr viewport,
29 const gfx::Rect& bounds, 29 const gfx::Rect& bounds,
30 const base::Callback<void()>& compositor_created_callback) 30 const base::Callback<void()>& compositor_created_callback)
31 : native_viewport_(viewport.Pass()), 31 : native_viewport_(viewport.Pass()),
32 compositor_created_callback_(compositor_created_callback), 32 compositor_created_callback_(compositor_created_callback),
33 bounds_(bounds) { 33 bounds_(bounds) {
34 native_viewport_.set_client(this); 34 native_viewport_.set_client(this);
35 native_viewport_->Create(Rect::From(bounds)); 35 native_viewport_->Create(Rect::From(bounds));
36 36
37 ScopedMessagePipeHandle gles2_handle, gles2_client_handle; 37 MessagePipe pipe;
38 CreateMessagePipe(&gles2_handle, &gles2_client_handle); 38 native_viewport_->CreateGLES2Context(
39 MakeRequest<CommandBuffer>(pipe.handle0.Pass()));
39 40
40 // The ContextFactory must exist before any Compositors are created. 41 // The ContextFactory must exist before any Compositors are created.
41 if (context_factory_) { 42 if (context_factory_) {
42 ui::ContextFactory::SetInstance(NULL); 43 ui::ContextFactory::SetInstance(NULL);
43 delete context_factory_; 44 delete context_factory_;
44 context_factory_ = NULL; 45 context_factory_ = NULL;
45 } 46 }
46 context_factory_ = new ContextFactoryMojo(gles2_handle.Pass()); 47 context_factory_ = new ContextFactoryMojo(pipe.handle1.Pass());
47 ui::ContextFactory::SetInstance(context_factory_); 48 ui::ContextFactory::SetInstance(context_factory_);
48 aura::Env::GetInstance()->set_context_factory(context_factory_); 49 aura::Env::GetInstance()->set_context_factory(context_factory_);
49 CHECK(context_factory_) << "No GL bindings."; 50 CHECK(context_factory_) << "No GL bindings.";
50
51 native_viewport_->CreateGLES2Context(gles2_client_handle.Pass());
52 } 51 }
53 52
54 WindowTreeHostMojo::~WindowTreeHostMojo() { 53 WindowTreeHostMojo::~WindowTreeHostMojo() {
55 DestroyCompositor(); 54 DestroyCompositor();
56 DestroyDispatcher(); 55 DestroyDispatcher();
57 } 56 }
58 57
59 //////////////////////////////////////////////////////////////////////////////// 58 ////////////////////////////////////////////////////////////////////////////////
60 // WindowTreeHostMojo, aura::WindowTreeHost implementation: 59 // WindowTreeHostMojo, aura::WindowTreeHost implementation:
61 60
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 event->flags, event->key_data->is_char); 166 event->flags, event->key_data->is_char);
168 SendEventToProcessor(&ev); 167 SendEventToProcessor(&ev);
169 break; 168 break;
170 } 169 }
171 // TODO(beng): touch, etc. 170 // TODO(beng): touch, etc.
172 } 171 }
173 callback.Run(); 172 callback.Run();
174 }; 173 };
175 174
176 } // namespace mojo 175 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/aura/context_factory_mojo.cc ('k') | mojo/cc/context_provider_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698