OLD | NEW |
---|---|
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 <assert.h> | 5 #include <assert.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 assert(event); | 70 assert(event); |
71 if (event->pointer_data.get()) | 71 if (event->pointer_data.get()) |
72 gles2_client_->HandleInputEvent(*event); | 72 gles2_client_->HandleInputEvent(*event); |
73 callback.Run(); | 73 callback.Run(); |
74 } | 74 } |
75 | 75 |
76 private: | 76 private: |
77 void SetEventDispatcher() { | 77 void SetEventDispatcher() { |
78 mojo::NativeViewportEventDispatcherPtr ptr; | 78 mojo::NativeViewportEventDispatcherPtr ptr; |
79 dispatcher_binding_.Bind(GetProxy(&ptr)); | 79 dispatcher_binding_.Bind(GetProxy(&ptr)); |
80 viewport_->SetEventDispatcher(ptr.Pass()); | 80 viewport_->SetEventDispatcher(ptr.PassInterfaceHandle()); |
viettrungluu
2016/02/10 01:04:08
So, this seems kind of dumb:
GetProxy() makes a m
vardhan
2016/02/11 22:47:53
Done.
| |
81 } | 81 } |
82 | 82 |
83 void OnViewportConnectionError() { mojo::RunLoop::current()->Quit(); } | 83 void OnViewportConnectionError() { mojo::RunLoop::current()->Quit(); } |
84 | 84 |
85 scoped_ptr<GLES2ClientImpl> gles2_client_; | 85 scoped_ptr<GLES2ClientImpl> gles2_client_; |
86 mojo::NativeViewportPtr viewport_; | 86 mojo::NativeViewportPtr viewport_; |
87 mojo::ContextProviderPtr onscreen_context_provider_; | 87 mojo::ContextProviderPtr onscreen_context_provider_; |
88 mojo::Binding<NativeViewportEventDispatcher> dispatcher_binding_; | 88 mojo::Binding<NativeViewportEventDispatcher> dispatcher_binding_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(SpinningCubeApp); | 90 DISALLOW_COPY_AND_ASSIGN(SpinningCubeApp); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace examples | 93 } // namespace examples |
94 | 94 |
95 MojoResult MojoMain(MojoHandle application_request) { | 95 MojoResult MojoMain(MojoHandle application_request) { |
96 mojo::ApplicationRunner runner(std::unique_ptr<examples::SpinningCubeApp>( | 96 mojo::ApplicationRunner runner(std::unique_ptr<examples::SpinningCubeApp>( |
97 new examples::SpinningCubeApp())); | 97 new examples::SpinningCubeApp())); |
98 return runner.Run(application_request); | 98 return runner.Run(application_request); |
99 } | 99 } |
OLD | NEW |