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

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

Issue 480723002: Revert of Mojo multiple command buffer support and sample (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | mojo/examples/pepper_container_app/pepper_container_app.cc » ('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
index c169d14c1258c66549edb2fcf70ca63bef24c2f2..513379e6d0fcaf0e7d03291c9b9b0302f19b29d2 100644
--- a/mojo/examples/compositor_app/compositor_app.cc
+++ b/mojo/examples/compositor_app/compositor_app.cc
@@ -11,7 +11,6 @@
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/services/public/cpp/geometry/geometry_type_converters.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"
@@ -29,22 +28,22 @@
viewport_->Create(Rect::From(gfx::Rect(10, 10, 800, 600)));
viewport_->Show();
- // TODO(jamesr): Should be mojo:mojo_gpu_service
- app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_);
+ MessagePipe pipe;
+ viewport_->CreateGLES2Context(
+ MakeRequest<CommandBuffer>(pipe.handle0.Pass()));
+ host_.reset(new CompositorHost(pipe.handle1.Pass()));
}
- virtual void OnCreated(uint64_t native_viewport_id) OVERRIDE {
- CommandBufferPtr cb;
- gpu_service_->CreateOnscreenGLES2Context(
- native_viewport_id, Size::From(gfx::Size(800, 600)), Get(&cb));
- host_.reset(new CompositorHost(cb.PassMessagePipe()));
+ virtual void OnCreated() OVERRIDE {
}
- virtual void OnDestroyed() OVERRIDE { base::MessageLoop::current()->Quit(); }
+ virtual void OnDestroyed(const mojo::Callback<void()>& callback) OVERRIDE {
+ base::MessageLoop::current()->Quit();
+ callback.Run();
+ }
virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE {
- if (host_)
- host_->SetSize(gfx::Size(bounds->width, bounds->height));
+ host_->SetSize(gfx::Size(bounds->width, bounds->height));
}
virtual void OnEvent(EventPtr event,
@@ -54,7 +53,6 @@
private:
NativeViewportPtr viewport_;
- GpuPtr gpu_service_;
scoped_ptr<CompositorHost> host_;
DISALLOW_COPY_AND_ASSIGN(SampleApp);
};
« no previous file with comments | « no previous file | mojo/examples/pepper_container_app/pepper_container_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698