summaryrefslogtreecommitdiffstats
path: root/mojo/examples/compositor_app
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 16:58:53 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 16:58:53 +0000
commita2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc (patch)
treed2bc930aa238d76884f56c12ab8e8d12b2126ba4 /mojo/examples/compositor_app
parentf88f20bb8ccea880db1700008e8cc15337c84247 (diff)
downloadchromium_src-a2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc.zip
chromium_src-a2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc.tar.gz
chromium_src-a2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc.tar.bz2
Support MojoMain() in an Application context
BUG= R=darin@chromium.org Review URL: https://codereview.chromium.org/302773005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples/compositor_app')
-rw-r--r--mojo/examples/compositor_app/compositor_app.cc33
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