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 "services/native_viewport/app_delegate.h" | 5 #include "services/native_viewport/app_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "gpu/config/gpu_util.h" | 9 #include "gpu/config/gpu_util.h" |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 gfx::GLSurface::InitializeOneOffForTests(); | 53 gfx::GLSurface::InitializeOneOffForTests(); |
54 else if (application->HasArg(mojo::kUseOSMesa)) | 54 else if (application->HasArg(mojo::kUseOSMesa)) |
55 gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL); | 55 gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL); |
56 else | 56 else |
57 gfx::GLSurface::InitializeOneOff(); | 57 gfx::GLSurface::InitializeOneOff(); |
58 | 58 |
59 is_headless_ = application->HasArg(mojo::kUseHeadlessConfig); | 59 is_headless_ = application->HasArg(mojo::kUseHeadlessConfig); |
60 } | 60 } |
61 | 61 |
62 bool NativeViewportAppDelegate::ConfigureIncomingConnection( | 62 bool NativeViewportAppDelegate::ConfigureIncomingConnection( |
63 mojo::ApplicationConnection* connection) { | 63 mojo::ServiceProviderImpl* service_provider_impl) { |
64 connection->GetServiceProviderImpl().AddService<mojo::NativeViewport>([this]( | 64 service_provider_impl->AddService<mojo::NativeViewport>([this]( |
65 const mojo::ConnectionContext& connection_context, | 65 const mojo::ConnectionContext& connection_context, |
66 mojo::InterfaceRequest<mojo::NativeViewport> native_viewport_request) { | 66 mojo::InterfaceRequest<mojo::NativeViewport> native_viewport_request) { |
67 if (!gpu_state_.get()) | 67 if (!gpu_state_.get()) |
68 gpu_state_ = new gles2::GpuState(); | 68 gpu_state_ = new gles2::GpuState(); |
69 new NativeViewportImpl(application_, is_headless_, gpu_state_, | 69 new NativeViewportImpl(application_, is_headless_, gpu_state_, |
70 native_viewport_request.Pass()); | 70 native_viewport_request.Pass()); |
71 }); | 71 }); |
72 | 72 |
73 connection->GetServiceProviderImpl().AddService<mojo::Gpu>( | 73 service_provider_impl->AddService<mojo::Gpu>( |
74 [this](const mojo::ConnectionContext& connection_context, | 74 [this](const mojo::ConnectionContext& connection_context, |
75 mojo::InterfaceRequest<mojo::Gpu> gpu_request) { | 75 mojo::InterfaceRequest<mojo::Gpu> gpu_request) { |
76 if (!gpu_state_.get()) | 76 if (!gpu_state_.get()) |
77 gpu_state_ = new gles2::GpuState(); | 77 gpu_state_ = new gles2::GpuState(); |
78 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); | 78 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); |
79 }); | 79 }); |
80 | 80 |
81 return true; | 81 return true; |
82 } | 82 } |
83 | 83 |
84 } // namespace native_viewport | 84 } // namespace native_viewport |
OLD | NEW |