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

Side by Side Diff: services/native_viewport/app_delegate.cc

Issue 1350723004: Apply gpu workarounds. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: need to use the process command_line so move the init to where the process command line is initiali… Created 5 years, 3 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
« no previous file with comments | « services/native_viewport/BUILD.gn ('k') | shell/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « services/native_viewport/BUILD.gn ('k') | shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698