| OLD | NEW |
| 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/gles2/gpu_state.h" |
| 9 #include "services/native_viewport/native_viewport_impl.h" | 9 #include "services/native_viewport/native_viewport_impl.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); | 26 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); |
| 27 } | 27 } |
| 28 | 28 |
| 29 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( | 29 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( |
| 30 mojo::ServiceProviderImpl* service_provider_impl) { | 30 mojo::ServiceProviderImpl* service_provider_impl) { |
| 31 service_provider_impl->AddService<mojo::NativeViewport>( | 31 service_provider_impl->AddService<mojo::NativeViewport>( |
| 32 [this](const ConnectionContext& connection_context, | 32 [this](const ConnectionContext& connection_context, |
| 33 InterfaceRequest<mojo::NativeViewport> native_viewport_request) { | 33 InterfaceRequest<mojo::NativeViewport> native_viewport_request) { |
| 34 if (!gpu_state_) | 34 if (!gpu_state_) |
| 35 gpu_state_ = new gles2::GpuState(); | 35 gpu_state_ = new gles2::GpuState(); |
| 36 new native_viewport::NativeViewportImpl(app_.get(), false, gpu_state_, | 36 new native_viewport::NativeViewportImpl( |
| 37 native_viewport_request.Pass()); | 37 app_->shell(), false, gpu_state_, native_viewport_request.Pass()); |
| 38 }); | 38 }); |
| 39 service_provider_impl->AddService<mojo::Gpu>( | 39 service_provider_impl->AddService<mojo::Gpu>( |
| 40 [this](const ConnectionContext& connection_context, | 40 [this](const ConnectionContext& connection_context, |
| 41 InterfaceRequest<mojo::Gpu> gpu_request) { | 41 InterfaceRequest<mojo::Gpu> gpu_request) { |
| 42 if (!gpu_state_) | 42 if (!gpu_state_) |
| 43 gpu_state_ = new gles2::GpuState(); | 43 gpu_state_ = new gles2::GpuState(); |
| 44 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); | 44 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); |
| 45 }); | 45 }); |
| 46 return true; | 46 return true; |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace shell | 49 } // namespace shell |
| OLD | NEW |