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

Side by Side Diff: mojo/examples/compositor_app/compositor_app.cc

Issue 272323003: Mojo: Implement support for |Foo&| mojom syntax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/cc/context_provider_mojo.cc ('k') | mojo/examples/compositor_app/compositor_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/macros.h" 8 #include "base/macros.h"
9 #include "mojo/examples/compositor_app/compositor_host.h" 9 #include "mojo/examples/compositor_app/compositor_host.h"
10 #include "mojo/public/cpp/application/application.h" 10 #include "mojo/public/cpp/application/application.h"
(...skipping 12 matching lines...) Expand all
23 SampleApp() {} 23 SampleApp() {}
24 virtual ~SampleApp() {} 24 virtual ~SampleApp() {}
25 25
26 virtual void Initialize() OVERRIDE { 26 virtual void Initialize() OVERRIDE {
27 ConnectTo("mojo:mojo_native_viewport_service", &viewport_); 27 ConnectTo("mojo:mojo_native_viewport_service", &viewport_);
28 viewport_.set_client(this); 28 viewport_.set_client(this);
29 29
30 viewport_->Create(Rect::From(gfx::Rect(10, 10, 800, 600))); 30 viewport_->Create(Rect::From(gfx::Rect(10, 10, 800, 600)));
31 viewport_->Show(); 31 viewport_->Show();
32 32
33 MessagePipe gles2_pipe; 33 MessagePipe pipe;
34 viewport_->CreateGLES2Context(gles2_pipe.handle0.Pass()); 34 viewport_->CreateGLES2Context(
35 host_.reset(new CompositorHost(gles2_pipe.handle1.Pass())); 35 MakeRequest<CommandBuffer>(pipe.handle0.Pass()));
36 host_.reset(new CompositorHost(pipe.handle1.Pass()));
36 } 37 }
37 38
38 virtual void OnCreated() OVERRIDE { 39 virtual void OnCreated() OVERRIDE {
39 } 40 }
40 41
41 virtual void OnDestroyed() OVERRIDE { 42 virtual void OnDestroyed() OVERRIDE {
42 base::MessageLoop::current()->Quit(); 43 base::MessageLoop::current()->Quit();
43 } 44 }
44 45
45 virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE { 46 virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE {
(...skipping 13 matching lines...) Expand all
59 }; 60 };
60 61
61 } // namespace examples 62 } // namespace examples
62 63
63 // static 64 // static
64 Application* Application::Create() { 65 Application* Application::Create() {
65 return new examples::SampleApp(); 66 return new examples::SampleApp();
66 } 67 }
67 68
68 } // namespace mojo 69 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/cc/context_provider_mojo.cc ('k') | mojo/examples/compositor_app/compositor_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698