| 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" | 9 #include "mojo/common/bindings_support_impl.h" |
| 10 #include "mojo/examples/sample_app/native_viewport_client_impl.h" | 10 #include "mojo/examples/sample_app/native_viewport_client_impl.h" |
| 11 #include "mojo/public/bindings/gles2_client/gles2_client_impl.h" | |
| 12 #include "mojo/public/bindings/lib/bindings_support.h" | 11 #include "mojo/public/bindings/lib/bindings_support.h" |
| 12 #include "mojo/public/gles2/adaptor.h" |
| 13 #include "mojo/public/system/core.h" | 13 #include "mojo/public/system/core.h" |
| 14 #include "mojo/public/system/macros.h" | 14 #include "mojo/public/system/macros.h" |
| 15 | 15 |
| 16 #if defined(WIN32) | 16 #if defined(WIN32) |
| 17 #if !defined(CDECL) | 17 #if !defined(CDECL) |
| 18 #define CDECL __cdecl | 18 #define CDECL __cdecl |
| 19 #endif | 19 #endif |
| 20 #define SAMPLE_APP_EXPORT __declspec(dllexport) | 20 #define SAMPLE_APP_EXPORT __declspec(dllexport) |
| 21 #else | 21 #else |
| 22 #define CDECL | 22 #define CDECL |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 base::MessageLoop::current()->Run(); | 33 base::MessageLoop::current()->Run(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace examples | 36 } // namespace examples |
| 37 } // namespace mojo | 37 } // namespace mojo |
| 38 | 38 |
| 39 extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain(MojoHandle pipe) { | 39 extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain(MojoHandle pipe) { |
| 40 base::MessageLoop loop; | 40 base::MessageLoop loop; |
| 41 mojo::common::BindingsSupportImpl bindings_support; | 41 mojo::common::BindingsSupportImpl bindings_support; |
| 42 mojo::BindingsSupport::Set(&bindings_support); | 42 mojo::BindingsSupport::Set(&bindings_support); |
| 43 mojo::GLES2ClientImpl::Initialize(); | 43 MojoGLES2Initialize(); |
| 44 | 44 |
| 45 mojo::ScopedMessagePipeHandle scoped_handle; | 45 mojo::ScopedMessagePipeHandle scoped_handle; |
| 46 scoped_handle.reset(mojo::MessagePipeHandle(pipe)); | 46 scoped_handle.reset(mojo::MessagePipeHandle(pipe)); |
| 47 mojo::examples::Start(scoped_handle.Pass()); | 47 mojo::examples::Start(scoped_handle.Pass()); |
| 48 | 48 |
| 49 mojo::GLES2ClientImpl::Terminate(); | 49 MojoGLES2Terminate(); |
| 50 mojo::BindingsSupport::Set(NULL); | 50 mojo::BindingsSupport::Set(NULL); |
| 51 return MOJO_RESULT_OK; | 51 return MOJO_RESULT_OK; |
| 52 } | 52 } |
| OLD | NEW |