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