OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |