OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This is a test application for gl_helper.*, which draws directly to a native | 5 // This is a test application for gl_helper.*, which draws directly to a native |
6 // viewport (without using the view manager). | 6 // viewport (without using the view manager). |
7 | 7 |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 #include <math.h> | 9 #include <math.h> |
10 | 10 |
11 #include "apps/moterm/gl_helper.h" | 11 #include "apps/moterm/gl_helper.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "mojo/application/application_runner_chromium.h" | 16 #include "mojo/application/application_runner_chromium.h" |
17 #include "mojo/public/c/system/main.h" | 17 #include "mojo/public/c/system/main.h" |
18 #include "mojo/public/cpp/application/application_impl.h" | 18 #include "mojo/public/cpp/application/application_impl.h" |
19 #include "mojo/services/geometry/public/interfaces/geometry.mojom.h" | 19 #include "mojo/services/geometry/interfaces/geometry.mojom.h" |
20 #include "mojo/services/gpu/public/interfaces/context_provider.mojom.h" | 20 #include "mojo/services/gpu/interfaces/context_provider.mojom.h" |
21 #include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom.
h" | 21 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" |
22 #include "mojo/services/surfaces/public/interfaces/display.mojom.h" | 22 #include "mojo/services/surfaces/public/interfaces/display.mojom.h" |
23 #include "mojo/services/surfaces/public/interfaces/quads.mojom.h" | 23 #include "mojo/services/surfaces/public/interfaces/quads.mojom.h" |
24 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h" | 24 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h" |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 GLuint LoadShader(GLenum type, const char* shader_source) { | 28 GLuint LoadShader(GLenum type, const char* shader_source) { |
29 GLuint shader = glCreateShader(type); | 29 GLuint shader = glCreateShader(type); |
30 CHECK(shader); | 30 CHECK(shader); |
31 glShaderSource(shader, 1, &shader_source, nullptr); | 31 glShaderSource(shader, 1, &shader_source, nullptr); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 }; | 270 }; |
271 | 271 |
272 const GLuint GlHelperExampleApp::kPositionLocation; | 272 const GLuint GlHelperExampleApp::kPositionLocation; |
273 | 273 |
274 } // namespace | 274 } // namespace |
275 | 275 |
276 MojoResult MojoMain(MojoHandle application_request) { | 276 MojoResult MojoMain(MojoHandle application_request) { |
277 mojo::ApplicationRunnerChromium runner(new GlHelperExampleApp()); | 277 mojo::ApplicationRunnerChromium runner(new GlHelperExampleApp()); |
278 return runner.Run(application_request); | 278 return runner.Run(application_request); |
279 } | 279 } |
OLD | NEW |