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

Side by Side Diff: apps/moterm/gl_helper_test_app.cc

Issue 1168993002: Update the native_viewport interface to allow specification of the surface configuration, currently… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Hopefully got all of the linux compile issues now... Created 5 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
OLDNEW
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
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // |mojo::ApplicationDelegate|: 211 // |mojo::ApplicationDelegate|:
212 void Initialize(mojo::ApplicationImpl* application_impl) override { 212 void Initialize(mojo::ApplicationImpl* application_impl) override {
213 DCHECK(!application_impl_); 213 DCHECK(!application_impl_);
214 application_impl_ = application_impl; 214 application_impl_ = application_impl;
215 215
216 application_impl->ConnectToService("mojo:native_viewport_service", 216 application_impl->ConnectToService("mojo:native_viewport_service",
217 &native_viewport_); 217 &native_viewport_);
218 viewport_size_.width = 800; 218 viewport_size_.width = 800;
219 viewport_size_.height = 600; 219 viewport_size_.height = 600;
220 native_viewport_->Create( 220 native_viewport_->Create(
221 viewport_size_.Clone(), 221 viewport_size_.Clone(), mojo::SurfaceConfiguration::New(),
viettrungluu 2015/06/09 22:38:35 It's up to you, but you could also just pass nullp
iansf 2015/06/09 23:45:25 That's true! For example apps like this, do you t
222 base::Bind(&GlHelperExampleApp::OnViewportMetricsReceived, 222 base::Bind(&GlHelperExampleApp::OnViewportMetricsReceived,
223 base::Unretained(this))); 223 base::Unretained(this)));
224 native_viewport_->Show(); 224 native_viewport_->Show();
225 225
226 mojo::ContextProviderPtr context_provider; 226 mojo::ContextProviderPtr context_provider;
227 native_viewport_->GetContextProvider(GetProxy(&context_provider)); 227 native_viewport_->GetContextProvider(GetProxy(&context_provider));
228 228
229 mojo::DisplayFactoryPtr display_factory; 229 mojo::DisplayFactoryPtr display_factory;
230 application_impl_->ConnectToService("mojo:surfaces_service", 230 application_impl_->ConnectToService("mojo:surfaces_service",
231 &display_factory); 231 &display_factory);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « no previous file | examples/spinning_cube/spinning_cube_app.cc » ('j') | services/native_viewport/native_viewport_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698