diff options
Diffstat (limited to 'mojo/examples/compositor_app')
-rw-r--r-- | mojo/examples/compositor_app/compositor_app.cc | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc index 583f4e9..db6e4e2 100644 --- a/mojo/examples/compositor_app/compositor_app.cc +++ b/mojo/examples/compositor_app/compositor_app.cc @@ -6,7 +6,6 @@ #include <string> #include "base/macros.h" -#include "base/message_loop/message_loop.h" #include "mojo/examples/compositor_app/compositor_host.h" #include "mojo/public/cpp/application/application.h" #include "mojo/public/cpp/bindings/allocation_scope.h" @@ -17,23 +16,15 @@ #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" #include "ui/gfx/rect.h" -#if defined(WIN32) -#if !defined(CDECL) -#define CDECL __cdecl -#endif -#define SAMPLE_APP_EXPORT __declspec(dllexport) -#else -#define CDECL -#define SAMPLE_APP_EXPORT __attribute__((visibility("default"))) -#endif - namespace mojo { namespace examples { class SampleApp : public Application, public NativeViewportClient { public: - explicit SampleApp(MojoHandle service_provider_handle) - : Application(service_provider_handle) { + SampleApp() {} + virtual ~SampleApp() {} + + virtual void Initialize() OVERRIDE { AllocationScope scope; ConnectTo("mojo:mojo_native_viewport_service", &viewport_); @@ -64,19 +55,17 @@ class SampleApp : public Application, public NativeViewportClient { } private: + mojo::GLES2Initializer gles2; NativeViewportPtr viewport_; scoped_ptr<CompositorHost> host_; + DISALLOW_COPY_AND_ASSIGN(SampleApp); }; } // namespace examples -} // namespace mojo -extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( - MojoHandle service_provider_handle) { - base::MessageLoop loop; - mojo::GLES2Initializer gles2; - - mojo::examples::SampleApp app(service_provider_handle); - loop.Run(); - return MOJO_RESULT_OK; +// static +Application* Application::Create() { + return new examples::SampleApp(); } + +} // namespace mojo |