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

Side by Side Diff: ui/gfx/mac/io_surface.cc

Issue 2924743002: gfx_unittests builds on 10.13 (Closed)
Patch Set: Created 3 years, 6 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 | « ui/gfx/icc_profile_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/gfx/mac/io_surface.h" 5 #include "ui/gfx/mac/io_surface.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 static bool color_correct_rendering_enabled = 212 static bool color_correct_rendering_enabled =
213 base::CommandLine::ForCurrentProcess()->HasSwitch( 213 base::CommandLine::ForCurrentProcess()->HasSwitch(
214 switches::kEnableColorCorrectRendering); 214 switches::kEnableColorCorrectRendering);
215 if (color_correct_rendering_enabled) 215 if (color_correct_rendering_enabled)
216 force_color_space = true; 216 force_color_space = true;
217 217
218 if (force_color_space) { 218 if (force_color_space) {
219 CGColorSpaceRef color_space = color_correct_rendering_enabled 219 CGColorSpaceRef color_space = color_correct_rendering_enabled
220 ? base::mac::GetSRGBColorSpace() 220 ? base::mac::GetSRGBColorSpace()
221 : base::mac::GetSystemColorSpace(); 221 : base::mac::GetSystemColorSpace();
222 base::ScopedCFTypeRef<CFDataRef> color_space_icc( 222 if (__builtin_available(macOS 10.12, *)) {
223 CGColorSpaceCopyICCProfile(color_space)); 223 base::ScopedCFTypeRef<CFDataRef> color_space_icc(
224 // Note that nullptr is an acceptable input to IOSurfaceSetValue. 224 CGColorSpaceCopyICCProfile(color_space));
225 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); 225 // Note that nullptr is an acceptable input to IOSurfaceSetValue.
226 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
227 }
226 } 228 }
227 229
228 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime", 230 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime",
229 base::TimeTicks::Now() - start_time); 231 base::TimeTicks::Now() - start_time);
230 return surface; 232 return surface;
231 } 233 }
232 234
233 } // namespace gfx 235 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/icc_profile_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698