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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/common/bindings_support_impl.h" | |
10 #include "mojo/examples/compositor_app/compositor_host.h" | 9 #include "mojo/examples/compositor_app/compositor_host.h" |
11 #include "mojo/examples/compositor_app/gles2_client_impl.h" | 10 #include "mojo/examples/compositor_app/gles2_client_impl.h" |
12 #include "mojo/public/bindings/lib/bindings_support.h" | |
13 #include "mojo/public/bindings/lib/remote_ptr.h" | 11 #include "mojo/public/bindings/lib/remote_ptr.h" |
14 #include "mojo/public/gles2/gles2.h" | 12 #include "mojo/public/gles2/gles2.h" |
15 #include "mojo/public/system/core.h" | 13 #include "mojo/public/system/core.h" |
16 #include "mojo/public/system/macros.h" | 14 #include "mojo/public/system/macros.h" |
17 #include "mojom/native_viewport.h" | 15 #include "mojom/native_viewport.h" |
18 #include "mojom/shell.h" | 16 #include "mojom/shell.h" |
19 | 17 |
20 #if defined(WIN32) | 18 #if defined(WIN32) |
21 #if !defined(CDECL) | 19 #if !defined(CDECL) |
22 #define CDECL __cdecl | 20 #define CDECL __cdecl |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 mojo::RemotePtr<Shell> shell_; | 89 mojo::RemotePtr<Shell> shell_; |
92 scoped_ptr<NativeViewportClientImpl> native_viewport_client_; | 90 scoped_ptr<NativeViewportClientImpl> native_viewport_client_; |
93 }; | 91 }; |
94 | 92 |
95 } // namespace examples | 93 } // namespace examples |
96 } // namespace mojo | 94 } // namespace mojo |
97 | 95 |
98 extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( | 96 extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( |
99 MojoHandle shell_handle) { | 97 MojoHandle shell_handle) { |
100 base::MessageLoop loop; | 98 base::MessageLoop loop; |
101 mojo::common::BindingsSupportImpl bindings_support_impl; | |
102 mojo::BindingsSupport::Set(&bindings_support_impl); | |
103 MojoGLES2Initialize(); | 99 MojoGLES2Initialize(); |
104 | 100 |
105 mojo::examples::SampleApp app( | 101 mojo::examples::SampleApp app( |
106 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); | 102 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); |
107 loop.Run(); | 103 loop.Run(); |
108 | 104 |
109 MojoGLES2Terminate(); | 105 MojoGLES2Terminate(); |
110 mojo::BindingsSupport::Set(NULL); | |
111 return MOJO_RESULT_OK; | 106 return MOJO_RESULT_OK; |
112 } | 107 } |
OLD | NEW |