OLD | NEW |
1 // Copyright (c) 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/services/view_manager/window_tree_host_impl.h" | 5 #include "mojo/services/view_manager/window_tree_host_impl.h" |
6 | 6 |
7 #include "mojo/public/c/gles2/gles2.h" | 7 #include "mojo/public/c/gles2/gles2.h" |
8 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 8 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
9 #include "mojo/services/view_manager/context_factory_impl.h" | 9 #include "mojo/services/view_manager/context_factory_impl.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
(...skipping 29 matching lines...) Expand all Loading... |
41 native_viewport_->CreateGLES2Context( | 41 native_viewport_->CreateGLES2Context( |
42 MakeRequest<CommandBuffer>(pipe.handle0.Pass())); | 42 MakeRequest<CommandBuffer>(pipe.handle0.Pass())); |
43 | 43 |
44 // The ContextFactory must exist before any Compositors are created. | 44 // The ContextFactory must exist before any Compositors are created. |
45 if (context_factory_) { | 45 if (context_factory_) { |
46 delete context_factory_; | 46 delete context_factory_; |
47 context_factory_ = NULL; | 47 context_factory_ = NULL; |
48 } | 48 } |
49 context_factory_ = new ContextFactoryImpl(pipe.handle1.Pass()); | 49 context_factory_ = new ContextFactoryImpl(pipe.handle1.Pass()); |
50 aura::Env::GetInstance()->set_context_factory(context_factory_); | 50 aura::Env::GetInstance()->set_context_factory(context_factory_); |
51 CHECK(context_factory_) << "No GL bindings."; | |
52 } | 51 } |
53 | 52 |
54 WindowTreeHostImpl::~WindowTreeHostImpl() { | 53 WindowTreeHostImpl::~WindowTreeHostImpl() { |
55 DestroyCompositor(); | 54 DestroyCompositor(); |
56 DestroyDispatcher(); | 55 DestroyDispatcher(); |
57 } | 56 } |
58 | 57 |
59 //////////////////////////////////////////////////////////////////////////////// | 58 //////////////////////////////////////////////////////////////////////////////// |
60 // WindowTreeHostImpl, aura::WindowTreeHost implementation: | 59 // WindowTreeHostImpl, aura::WindowTreeHost implementation: |
61 | 60 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 break; | 175 break; |
177 } | 176 } |
178 // TODO(beng): touch, etc. | 177 // TODO(beng): touch, etc. |
179 } | 178 } |
180 callback.Run(); | 179 callback.Run(); |
181 }; | 180 }; |
182 | 181 |
183 } // namespace service | 182 } // namespace service |
184 } // namespace view_manager | 183 } // namespace view_manager |
185 } // namespace mojo | 184 } // namespace mojo |
OLD | NEW |