OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/mac/mac_util.h" | 5 #include "base/mac/mac_util.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #import <IOKit/IOKitLib.h> | 8 #import <IOKit/IOKitLib.h> |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 DLOG(WARNING) << | 166 DLOG(WARNING) << |
167 "Couldn't get the main display's color space, using generic"; | 167 "Couldn't get the main display's color space, using generic"; |
168 } else { | 168 } else { |
169 DLOG(ERROR) << "Couldn't get any color space"; | 169 DLOG(ERROR) << "Couldn't get any color space"; |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 return g_system_color_space; | 173 return g_system_color_space; |
174 } | 174 } |
175 | 175 |
176 bool IsCGFloatEqual(CGFloat a, CGFloat b) { | |
177 return fabs(a - b) <= std::numeric_limits<CGFloat>::epsilon(); | |
Mark Mentovai
2016/10/19 02:36:09
#include <cmath> and use std::fabs() or std::abs()
spqchan
2016/10/19 03:46:12
Done.
| |
178 } | |
179 | |
176 // Add a request for full screen mode. Must be called on the main thread. | 180 // Add a request for full screen mode. Must be called on the main thread. |
177 void RequestFullScreen(FullScreenMode mode) { | 181 void RequestFullScreen(FullScreenMode mode) { |
178 DCHECK_LT(mode, kNumFullScreenModes); | 182 DCHECK_LT(mode, kNumFullScreenModes); |
179 if (mode >= kNumFullScreenModes) | 183 if (mode >= kNumFullScreenModes) |
180 return; | 184 return; |
181 | 185 |
182 DCHECK_GE(g_full_screen_requests[mode], 0); | 186 DCHECK_GE(g_full_screen_requests[mode], 0); |
183 if (mode < 0) | 187 if (mode < 0) |
184 return; | 188 return; |
185 | 189 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
475 StringPiece(begin + comma_loc + 1, ident.end()), &minor_tmp)) | 479 StringPiece(begin + comma_loc + 1, ident.end()), &minor_tmp)) |
476 return false; | 480 return false; |
477 *type = ident.substr(0, number_loc); | 481 *type = ident.substr(0, number_loc); |
478 *major = major_tmp; | 482 *major = major_tmp; |
479 *minor = minor_tmp; | 483 *minor = minor_tmp; |
480 return true; | 484 return true; |
481 } | 485 } |
482 | 486 |
483 } // namespace mac | 487 } // namespace mac |
484 } // namespace base | 488 } // namespace base |
OLD | NEW |