| 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" |
| 6 |
| 5 #include <vector> | 7 #include <vector> |
| 6 #include "services/native_viewport/app_delegate.h" | 8 #include "gpu/config/gpu_util.h" |
| 7 | 9 |
| 8 namespace native_viewport { | 10 namespace native_viewport { |
| 9 | 11 |
| 10 NativeViewportAppDelegate::NativeViewportAppDelegate() : is_headless_(false) {} | 12 NativeViewportAppDelegate::NativeViewportAppDelegate() : is_headless_(false) {} |
| 11 | 13 |
| 12 NativeViewportAppDelegate::~NativeViewportAppDelegate() {} | 14 NativeViewportAppDelegate::~NativeViewportAppDelegate() {} |
| 13 | 15 |
| 14 void NativeViewportAppDelegate::InitLogging( | 16 void NativeViewportAppDelegate::InitLogging( |
| 15 mojo::ApplicationImpl* application) { | 17 mojo::ApplicationImpl* application) { |
| 16 std::vector<const char*> args; | 18 std::vector<const char*> args; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 37 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 39 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 38 const std::string touch_event_string("--" + | 40 const std::string touch_event_string("--" + |
| 39 std::string(switches::kTouchDevices)); | 41 std::string(switches::kTouchDevices)); |
| 40 auto touch_iter = std::find(application->args().begin(), | 42 auto touch_iter = std::find(application->args().begin(), |
| 41 application->args().end(), touch_event_string); | 43 application->args().end(), touch_event_string); |
| 42 if (touch_iter != application->args().end() && | 44 if (touch_iter != application->args().end() && |
| 43 ++touch_iter != application->args().end()) { | 45 ++touch_iter != application->args().end()) { |
| 44 command_line->AppendSwitchASCII(touch_event_string, *touch_iter); | 46 command_line->AppendSwitchASCII(touch_event_string, *touch_iter); |
| 45 } | 47 } |
| 46 | 48 |
| 49 gpu::ApplyGpuDriverBugWorkarounds(command_line); |
| 50 |
| 47 if (application->HasArg(mojo::kUseTestConfig)) | 51 if (application->HasArg(mojo::kUseTestConfig)) |
| 48 gfx::GLSurface::InitializeOneOffForTests(); | 52 gfx::GLSurface::InitializeOneOffForTests(); |
| 49 else if (application->HasArg(mojo::kUseOSMesa)) | 53 else if (application->HasArg(mojo::kUseOSMesa)) |
| 50 gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL); | 54 gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL); |
| 51 else | 55 else |
| 52 gfx::GLSurface::InitializeOneOff(); | 56 gfx::GLSurface::InitializeOneOff(); |
| 53 | 57 |
| 54 is_headless_ = application->HasArg(mojo::kUseHeadlessConfig); | 58 is_headless_ = application->HasArg(mojo::kUseHeadlessConfig); |
| 55 } | 59 } |
| 56 | 60 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 71 } | 75 } |
| 72 | 76 |
| 73 void NativeViewportAppDelegate::Create(ApplicationConnection* connection, | 77 void NativeViewportAppDelegate::Create(ApplicationConnection* connection, |
| 74 mojo::InterfaceRequest<Gpu> request) { | 78 mojo::InterfaceRequest<Gpu> request) { |
| 75 if (!gpu_state_.get()) | 79 if (!gpu_state_.get()) |
| 76 gpu_state_ = new gles2::GpuState; | 80 gpu_state_ = new gles2::GpuState; |
| 77 new gles2::GpuImpl(request.Pass(), gpu_state_); | 81 new gles2::GpuImpl(request.Pass(), gpu_state_); |
| 78 } | 82 } |
| 79 | 83 |
| 80 } // namespace native_viewport | 84 } // namespace native_viewport |
| OLD | NEW |