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

Side by Side Diff: shell/android/native_viewport_application_loader.cc

Issue 940293003: Add a Display and ContextProvider concept to mojom, use to recreate (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "shell/android/native_viewport_application_loader.h" 5 #include "shell/android/native_viewport_application_loader.h"
6 6
7 #include "mojo/public/cpp/application/application_impl.h" 7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "services/gles2/gpu_state.h"
8 #include "services/native_viewport/native_viewport_impl.h" 9 #include "services/native_viewport/native_viewport_impl.h"
9 #include "shell/android/keyboard_impl.h" 10 #include "shell/android/keyboard_impl.h"
10 11
11 namespace mojo { 12 namespace mojo {
12 namespace shell { 13 namespace shell {
13 14
14 NativeViewportApplicationLoader::NativeViewportApplicationLoader() { 15 NativeViewportApplicationLoader::NativeViewportApplicationLoader() {
15 } 16 }
16 17
17 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() { 18 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() {
(...skipping 10 matching lines...) Expand all
28 mojo::ApplicationConnection* connection) { 29 mojo::ApplicationConnection* connection) {
29 connection->AddService<NativeViewport>(this); 30 connection->AddService<NativeViewport>(this);
30 connection->AddService<Gpu>(this); 31 connection->AddService<Gpu>(this);
31 connection->AddService<Keyboard>(this); 32 connection->AddService<Keyboard>(this);
32 return true; 33 return true;
33 } 34 }
34 35
35 void NativeViewportApplicationLoader::Create( 36 void NativeViewportApplicationLoader::Create(
36 ApplicationConnection* connection, 37 ApplicationConnection* connection,
37 InterfaceRequest<NativeViewport> request) { 38 InterfaceRequest<NativeViewport> request) {
38 new native_viewport::NativeViewportImpl(app_.get(), false, request.Pass()); 39 if (!gpu_state_)
40 gpu_state_ = new gles2::GpuState;
41 new native_viewport::NativeViewportImpl(app_.get(), gpu_state_,
qsr 2015/03/04 10:33:18 This cuts android head. Or to be less cryptic, th
jamesr 2015/03/04 23:00:27 Ouch! Fixed.
42 request.Pass());
39 } 43 }
40 44
41 void NativeViewportApplicationLoader::Create( 45 void NativeViewportApplicationLoader::Create(
42 ApplicationConnection* connection, 46 ApplicationConnection* connection,
43 InterfaceRequest<Keyboard> request) { 47 InterfaceRequest<Keyboard> request) {
44 new KeyboardImpl(request.Pass()); 48 new KeyboardImpl(request.Pass());
45 } 49 }
46 50
47 void NativeViewportApplicationLoader::Create(ApplicationConnection* connection, 51 void NativeViewportApplicationLoader::Create(ApplicationConnection* connection,
48 InterfaceRequest<Gpu> request) { 52 InterfaceRequest<Gpu> request) {
49 if (!gpu_state_) 53 if (!gpu_state_)
50 gpu_state_ = new gles2::GpuImpl::State; 54 gpu_state_ = new gles2::GpuState;
51 new gles2::GpuImpl(request.Pass(), gpu_state_); 55 new gles2::GpuImpl(request.Pass(), gpu_state_);
52 } 56 }
53 57
54 } // namespace shell 58 } // namespace shell
55 } // namespace mojo 59 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698