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

Side by Side Diff: mojo/examples/sample_app/sample_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/examples/sample_app/gles2_client_impl.cc ('k') | mojo/gles2/command_buffer_client_impl.cc » ('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 "mojo/examples/sample_app/gles2_client_impl.h" 8 #include "mojo/examples/sample_app/gles2_client_impl.h"
9 #include "mojo/public/cpp/application/application.h" 9 #include "mojo/public/cpp/application/application.h"
10 #include "mojo/public/cpp/gles2/gles2.h" 10 #include "mojo/public/cpp/gles2/gles2.h"
(...skipping 20 matching lines...) Expand all
31 viewport_.set_client(this); 31 viewport_.set_client(this);
32 32
33 RectPtr rect(Rect::New()); 33 RectPtr rect(Rect::New());
34 rect->x = 10; 34 rect->x = 10;
35 rect->y = 10; 35 rect->y = 10;
36 rect->width = 800; 36 rect->width = 800;
37 rect->height = 600; 37 rect->height = 600;
38 viewport_->Create(rect.Pass()); 38 viewport_->Create(rect.Pass());
39 viewport_->Show(); 39 viewport_->Show();
40 40
41 MessagePipe gles2_pipe; 41 CommandBufferPtr command_buffer;
42 viewport_->CreateGLES2Context(gles2_pipe.handle0.Pass()); 42 viewport_->CreateGLES2Context(Get(&command_buffer));
43 gles2_client_.reset(new GLES2ClientImpl(gles2_pipe.handle1.Pass())); 43 gles2_client_.reset(new GLES2ClientImpl(command_buffer.Pass()));
44 } 44 }
45 45
46 virtual void OnCreated() MOJO_OVERRIDE { 46 virtual void OnCreated() MOJO_OVERRIDE {
47 } 47 }
48 48
49 virtual void OnDestroyed() MOJO_OVERRIDE { 49 virtual void OnDestroyed() MOJO_OVERRIDE {
50 RunLoop::current()->Quit(); 50 RunLoop::current()->Quit();
51 } 51 }
52 52
53 virtual void OnBoundsChanged(RectPtr bounds) MOJO_OVERRIDE { 53 virtual void OnBoundsChanged(RectPtr bounds) MOJO_OVERRIDE {
(...skipping 21 matching lines...) Expand all
75 }; 75 };
76 76
77 } // namespace examples 77 } // namespace examples
78 78
79 // static 79 // static
80 Application* Application::Create() { 80 Application* Application::Create() {
81 return new examples::SampleApp(); 81 return new examples::SampleApp();
82 } 82 }
83 83
84 } // namespace mojo 84 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/gles2/command_buffer_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698