OLD | NEW |
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/geometry/geometry_type_converters.h" | 8 #include "mojo/geometry/geometry_type_converters.h" |
9 #include "mojo/public/c/gles2/gles2.h" | 9 #include "mojo/public/c/gles2/gles2.h" |
10 #include "mojo/public/cpp/bindings/allocation_scope.h" | 10 #include "mojo/public/cpp/bindings/allocation_scope.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 CreateMessagePipe(&gles2_handle, &gles2_client_handle); | 41 CreateMessagePipe(&gles2_handle, &gles2_client_handle); |
42 | 42 |
43 // The ContextFactory must exist before any Compositors are created. | 43 // The ContextFactory must exist before any Compositors are created. |
44 if (context_factory_) { | 44 if (context_factory_) { |
45 ui::ContextFactory::SetInstance(NULL); | 45 ui::ContextFactory::SetInstance(NULL); |
46 delete context_factory_; | 46 delete context_factory_; |
47 context_factory_ = NULL; | 47 context_factory_ = NULL; |
48 } | 48 } |
49 context_factory_ = new ContextFactoryMojo(gles2_handle.Pass()); | 49 context_factory_ = new ContextFactoryMojo(gles2_handle.Pass()); |
50 ui::ContextFactory::SetInstance(context_factory_); | 50 ui::ContextFactory::SetInstance(context_factory_); |
| 51 aura::Env::GetInstance()->set_context_factory(context_factory_); |
51 CHECK(context_factory_) << "No GL bindings."; | 52 CHECK(context_factory_) << "No GL bindings."; |
52 | 53 |
53 native_viewport_->CreateGLES2Context(gles2_client_handle.Pass()); | 54 native_viewport_->CreateGLES2Context(gles2_client_handle.Pass()); |
54 } | 55 } |
55 | 56 |
56 WindowTreeHostMojo::~WindowTreeHostMojo() { | 57 WindowTreeHostMojo::~WindowTreeHostMojo() { |
57 DestroyCompositor(); | 58 DestroyCompositor(); |
58 DestroyDispatcher(); | 59 DestroyDispatcher(); |
59 } | 60 } |
60 | 61 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 event.flags(), event.key_data().is_char()); | 172 event.flags(), event.key_data().is_char()); |
172 SendEventToProcessor(&ev); | 173 SendEventToProcessor(&ev); |
173 break; | 174 break; |
174 } | 175 } |
175 // TODO(beng): touch, etc. | 176 // TODO(beng): touch, etc. |
176 } | 177 } |
177 callback.Run(); | 178 callback.Run(); |
178 }; | 179 }; |
179 | 180 |
180 } // namespace mojo | 181 } // namespace mojo |
OLD | NEW |