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

Side by Side Diff: gpu/ipc/service/gpu_init.cc

Issue 2938543002: Detect HDR capability (Closed)
Patch Set: histograms updated Created 3 years, 5 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 | « gpu/ipc/service/direct_composition_surface_win.cc ('k') | tools/metrics/histograms/enums.xml » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "gpu/ipc/service/gpu_init.h" 5 #include "gpu/ipc/service/gpu_init.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
(...skipping 10 matching lines...) Expand all
21 #include "ui/gl/gl_implementation.h" 21 #include "ui/gl/gl_implementation.h"
22 #include "ui/gl/gl_switches.h" 22 #include "ui/gl/gl_switches.h"
23 #include "ui/gl/gl_utils.h" 23 #include "ui/gl/gl_utils.h"
24 #include "ui/gl/init/gl_factory.h" 24 #include "ui/gl/init/gl_factory.h"
25 25
26 #if defined(USE_OZONE) 26 #if defined(USE_OZONE)
27 #include "ui/ozone/public/ozone_platform.h" 27 #include "ui/ozone/public/ozone_platform.h"
28 #endif 28 #endif
29 29
30 #if defined(OS_WIN) 30 #if defined(OS_WIN)
31 #include "gpu/ipc/service/child_window_surface_win.h"
31 #include "gpu/ipc/service/direct_composition_surface_win.h" 32 #include "gpu/ipc/service/direct_composition_surface_win.h"
32 #endif 33 #endif
33 34
34 namespace gpu { 35 namespace gpu {
35 36
36 namespace { 37 namespace {
37 38
38 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, 39 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info,
39 const base::CommandLine& command_line) { 40 const base::CommandLine& command_line) {
40 if (!command_line.HasSwitch(switches::kGpuVendorID) || 41 if (!command_line.HasSwitch(switches::kGpuVendorID) ||
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 case gpu::kCollectInfoSuccess: 104 case gpu::kCollectInfoSuccess:
104 break; 105 break;
105 } 106 }
106 107
107 #if defined(OS_WIN) 108 #if defined(OS_WIN)
108 if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2 && 109 if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2 &&
109 gl::GLSurfaceEGL::IsDirectCompositionSupported() && 110 gl::GLSurfaceEGL::IsDirectCompositionSupported() &&
110 DirectCompositionSurfaceWin::AreOverlaysSupported()) { 111 DirectCompositionSurfaceWin::AreOverlaysSupported()) {
111 gpu_info.supports_overlays = true; 112 gpu_info.supports_overlays = true;
112 } 113 }
114 if (DirectCompositionSurfaceWin::IsHDRSupported()) {
115 gpu_info.hdr = true;
116 }
113 #endif // defined(OS_WIN) 117 #endif // defined(OS_WIN)
114 } 118 }
115 #endif // defined(OS_MACOSX) 119 #endif // defined(OS_MACOSX)
116 120
117 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 121 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
118 bool CanAccessNvidiaDeviceFile() { 122 bool CanAccessNvidiaDeviceFile() {
119 bool res = true; 123 bool res = true;
120 base::ThreadRestrictions::AssertIOAllowed(); 124 base::ThreadRestrictions::AssertIOAllowed();
121 if (access("/dev/nvidiactl", R_OK) != 0) { 125 if (access("/dev/nvidiactl", R_OK) != 0) {
122 DVLOG(1) << "NVIDIA device file /dev/nvidiactl access denied"; 126 DVLOG(1) << "NVIDIA device file /dev/nvidiactl access denied";
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 283
280 if (!gpu_info_.sandboxed && !attempted_startsandbox) { 284 if (!gpu_info_.sandboxed && !attempted_startsandbox) {
281 gpu_info_.sandboxed = 285 gpu_info_.sandboxed =
282 sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get()); 286 sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get());
283 } 287 }
284 288
285 return true; 289 return true;
286 } 290 }
287 291
288 } // namespace gpu 292 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.cc ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698