| 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/public/c/gles2/gles2.h" | 8 #include "mojo/public/c/gles2/gles2.h" |
| 9 #include "mojo/public/cpp/bindings/allocation_scope.h" | 9 #include "mojo/public/cpp/bindings/allocation_scope.h" |
| 10 #include "mojo/services/native_viewport/geometry_conversions.h" | 10 #include "mojo/services/native_viewport/geometry_conversions.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // WindowTreeHostMojo, ui::EventSource implementation: | 126 // WindowTreeHostMojo, ui::EventSource implementation: |
| 127 | 127 |
| 128 ui::EventProcessor* WindowTreeHostMojo::GetEventProcessor() { | 128 ui::EventProcessor* WindowTreeHostMojo::GetEventProcessor() { |
| 129 return dispatcher(); | 129 return dispatcher(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 //////////////////////////////////////////////////////////////////////////////// | 132 //////////////////////////////////////////////////////////////////////////////// |
| 133 // WindowTreeHostMojo, NativeViewportClient implementation: | 133 // WindowTreeHostMojo, NativeViewportClient implementation: |
| 134 | 134 |
| 135 void WindowTreeHostMojo::OnCreated() { | 135 void WindowTreeHostMojo::OnCreated() { |
| 136 CreateCompositor(GetAcceleratedWidget()); | 136 CreateCompositor(GetAcceleratedWidget(), context_factory_); |
| 137 compositor_created_callback_.Run(); | 137 compositor_created_callback_.Run(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void WindowTreeHostMojo::OnBoundsChanged(const Rect& bounds) { | 140 void WindowTreeHostMojo::OnBoundsChanged(const Rect& bounds) { |
| 141 bounds_ = gfx::Rect(bounds.position().x(), bounds.position().y(), | 141 bounds_ = gfx::Rect(bounds.position().x(), bounds.position().y(), |
| 142 bounds.size().width(), bounds.size().height()); | 142 bounds.size().width(), bounds.size().height()); |
| 143 window()->SetBounds(gfx::Rect(bounds_.size())); | 143 window()->SetBounds(gfx::Rect(bounds_.size())); |
| 144 OnHostResized(bounds_.size()); | 144 OnHostResized(bounds_.size()); |
| 145 } | 145 } |
| 146 | 146 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 171 event.flags(), event.key_data().is_char()); | 171 event.flags(), event.key_data().is_char()); |
| 172 SendEventToProcessor(&ev); | 172 SendEventToProcessor(&ev); |
| 173 break; | 173 break; |
| 174 } | 174 } |
| 175 // TODO(beng): touch, etc. | 175 // TODO(beng): touch, etc. |
| 176 } | 176 } |
| 177 callback.Run(); | 177 callback.Run(); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace mojo | 180 } // namespace mojo |
| OLD | NEW |