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

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

Issue 2288003002: Delete IsAtLeastOS10_9() and IsAtMostOS10_9() (Closed)
Patch Set: Rebase, cancel the more confusing changes Created 4 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 | « sandbox/mac/os_compatibility.cc ('k') | ui/gl/test/gl_image_test_template.h » ('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 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/logging.h" 10 #include "base/logging.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 IOSurfaceRef surface = IOSurfaceCreate(properties); 159 IOSurfaceRef surface = IOSurfaceCreate(properties);
160 160
161 // For unknown reasons, triggering this lock on OS X 10.9, on certain GPUs, 161 // For unknown reasons, triggering this lock on OS X 10.9, on certain GPUs,
162 // causes PDFs to render incorrectly. Hopefully this check can be removed once 162 // causes PDFs to render incorrectly. Hopefully this check can be removed once
163 // pdfium switches to a Skia backend on Mac. 163 // pdfium switches to a Skia backend on Mac.
164 // https://crbug.com/594343. 164 // https://crbug.com/594343.
165 // IOSurface clearing causes significant performance regression on about half 165 // IOSurface clearing causes significant performance regression on about half
166 // of all devices running Yosemite. https://crbug.com/606850#c22. 166 // of all devices running Yosemite. https://crbug.com/606850#c22.
167 bool should_clear = !base::mac::IsOS10_9() && !base::mac::IsOS10_10(); 167 bool should_clear = base::mac::IsAtLeastOS10_11();
168 168
169 if (should_clear) { 169 if (should_clear) {
170 // Zero-initialize the IOSurface. Calling IOSurfaceLock/IOSurfaceUnlock 170 // Zero-initialize the IOSurface. Calling IOSurfaceLock/IOSurfaceUnlock
171 // appears to be sufficient. https://crbug.com/584760#c17 171 // appears to be sufficient. https://crbug.com/584760#c17
172 IOReturn r = IOSurfaceLock(surface, 0, nullptr); 172 IOReturn r = IOSurfaceLock(surface, 0, nullptr);
173 DCHECK_EQ(kIOReturnSuccess, r); 173 DCHECK_EQ(kIOReturnSuccess, r);
174 r = IOSurfaceUnlock(surface, 0, nullptr); 174 r = IOSurfaceUnlock(surface, 0, nullptr);
175 DCHECK_EQ(kIOReturnSuccess, r); 175 DCHECK_EQ(kIOReturnSuccess, r);
176 } 176 }
177 177
(...skipping 11 matching lines...) Expand all
189 // Note that nullptr is an acceptable input to IOSurfaceSetValue. 189 // Note that nullptr is an acceptable input to IOSurfaceSetValue.
190 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); 190 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
191 } 191 }
192 192
193 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime", 193 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime",
194 base::TimeTicks::Now() - start_time); 194 base::TimeTicks::Now() - start_time);
195 return surface; 195 return surface;
196 } 196 }
197 197
198 } // namespace gfx 198 } // namespace gfx
OLDNEW
« no previous file with comments | « sandbox/mac/os_compatibility.cc ('k') | ui/gl/test/gl_image_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698