Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1078)

Unified Diff: mojo/examples/compositor_app/compositor_app.cc

Issue 640023004: cc: Make OutputSurface::SwapBuffers pure virtual (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@latinfo
Patch Set: rebase, comment, removed unused includes Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/examples/compositor_app/DEPS ('k') | mojo/examples/compositor_app/compositor_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/compositor_app/compositor_app.cc
diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc
deleted file mode 100644
index 3a29ed21ca9646befe22d9db3279ed33d4a0cc9f..0000000000000000000000000000000000000000
--- a/mojo/examples/compositor_app/compositor_app.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdio.h>
-#include <string>
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "mojo/application/application_runner_chromium.h"
-#include "mojo/converters/geometry/geometry_type_converters.h"
-#include "mojo/examples/compositor_app/compositor_host.h"
-#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/application_impl.h"
-#include "mojo/public/cpp/system/core.h"
-#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
-#include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.h"
-#include "ui/gfx/rect.h"
-
-namespace mojo {
-namespace examples {
-
-class SampleApp : public ApplicationDelegate, public NativeViewportClient {
- public:
- SampleApp() : weak_factory_(this) {}
- virtual ~SampleApp() {}
-
- virtual void Initialize(ApplicationImpl* app) override {
- app->ConnectToService("mojo:mojo_native_viewport_service", &viewport_);
- viewport_.set_client(this);
- viewport_->Create(Size::From(gfx::Size(800, 600)),
- base::Bind(&SampleApp::OnCreatedNativeViewport,
- weak_factory_.GetWeakPtr()));
- viewport_->Show();
-
- // TODO(jamesr): Should be mojo:mojo_gpu_service
- app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_);
- }
-
- virtual void OnDestroyed() override { base::MessageLoop::current()->Quit(); }
-
- virtual void OnSizeChanged(SizePtr size) override {
- if (host_)
- host_->SetSize(size.To<gfx::Size>());
- }
-
- virtual void OnEvent(EventPtr event,
- const mojo::Callback<void()>& callback) override {
- callback.Run();
- }
-
- private:
- void OnCreatedNativeViewport(uint64_t native_viewport_id) {
- CommandBufferPtr cb;
- // TODO(jamesr): Output to a surface instead.
- gpu_service_->CreateOnscreenGLES2Context(
- native_viewport_id, Size::From(gfx::Size(800, 600)), GetProxy(&cb));
- host_.reset(new CompositorHost(cb.PassMessagePipe()));
- }
-
-
- NativeViewportPtr viewport_;
- GpuPtr gpu_service_;
- scoped_ptr<CompositorHost> host_;
- base::WeakPtrFactory<SampleApp> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(SampleApp);
-};
-
-} // namespace examples
-} // namespace mojo
-
-MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunnerChromium runner(new mojo::examples::SampleApp);
- return runner.Run(shell_handle);
-}
« no previous file with comments | « mojo/examples/compositor_app/DEPS ('k') | mojo/examples/compositor_app/compositor_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698