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

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: android fixes Created 5 years, 10 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 15 matching lines...) Expand all
33 mojo::ApplicationConnection* connection) { 34 mojo::ApplicationConnection* connection) {
34 connection->AddService<NativeViewport>(this); 35 connection->AddService<NativeViewport>(this);
35 connection->AddService<Gpu>(this); 36 connection->AddService<Gpu>(this);
36 connection->AddService<Keyboard>(this); 37 connection->AddService<Keyboard>(this);
37 return true; 38 return true;
38 } 39 }
39 40
40 void NativeViewportApplicationLoader::Create( 41 void NativeViewportApplicationLoader::Create(
41 ApplicationConnection* connection, 42 ApplicationConnection* connection,
42 InterfaceRequest<NativeViewport> request) { 43 InterfaceRequest<NativeViewport> request) {
43 new native_viewport::NativeViewportImpl(app_.get(), false, request.Pass()); 44 if (!gpu_state_)
45 gpu_state_ = new gles2::GpuState;
46 new native_viewport::NativeViewportImpl(app_.get(), gpu_state_,
47 request.Pass());
44 } 48 }
45 49
46 void NativeViewportApplicationLoader::Create( 50 void NativeViewportApplicationLoader::Create(
47 ApplicationConnection* connection, 51 ApplicationConnection* connection,
48 InterfaceRequest<Keyboard> request) { 52 InterfaceRequest<Keyboard> request) {
49 new KeyboardImpl(request.Pass()); 53 new KeyboardImpl(request.Pass());
50 } 54 }
51 55
52 void NativeViewportApplicationLoader::Create(ApplicationConnection* connection, 56 void NativeViewportApplicationLoader::Create(ApplicationConnection* connection,
53 InterfaceRequest<Gpu> request) { 57 InterfaceRequest<Gpu> request) {
54 if (!gpu_state_) 58 if (!gpu_state_)
55 gpu_state_ = new gles2::GpuImpl::State; 59 gpu_state_ = new gles2::GpuState;
56 new gles2::GpuImpl(request.Pass(), gpu_state_); 60 new gles2::GpuImpl(request.Pass(), gpu_state_);
57 } 61 }
58 62
59 } // namespace shell 63 } // namespace shell
60 } // namespace mojo 64 } // namespace mojo
OLDNEW
« services/surfaces/display_impl.cc ('K') | « shell/android/native_viewport_application_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698