| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 SInt32 minor = 0; | 75 SInt32 minor = 0; |
| 76 // These selectors don't exist pre 10.4 but as we check the error | 76 // These selectors don't exist pre 10.4 but as we check the error |
| 77 // the function will correctly return NO which is the right answer. | 77 // the function will correctly return NO which is the right answer. |
| 78 result = ((::Gestalt(gestaltSystemVersionMajor, &major) == noErr) && | 78 result = ((::Gestalt(gestaltSystemVersionMajor, &major) == noErr) && |
| 79 (::Gestalt(gestaltSystemVersionMinor, &minor) == noErr) && | 79 (::Gestalt(gestaltSystemVersionMinor, &minor) == noErr) && |
| 80 ((major > 10) || (major == 10 && minor >= 5))); | 80 ((major > 10) || (major == 10 && minor >= 5))); |
| 81 isCached = true; | 81 isCached = true; |
| 82 } | 82 } |
| 83 return result; | 83 return result; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // Returns whether OS is 10.6 (Snow Leopard) or higher. | 86 // Returns whether OS is 10.6 (Snow Leopard) or higher. |
| 87 bool IsMacOSTenSixOrHigher() { | 87 bool IsMacOSTenSixOrHigher() { |
| 88 static bool isCached = false, result = false; | 88 static bool isCached = false, result = false; |
| 89 | 89 |
| 90 if (!isCached) { | 90 if (!isCached) { |
| 91 SInt32 major = 0; | 91 SInt32 major = 0; |
| 92 SInt32 minor = 0; | 92 SInt32 minor = 0; |
| 93 // These selectors don't exist pre 10.4 but as we check the error | 93 // These selectors don't exist pre 10.4 but as we check the error |
| 94 // the function will correctly return NO which is the right answer. | 94 // the function will correctly return NO which is the right answer. |
| 95 result = ((::Gestalt(gestaltSystemVersionMajor, &major) == noErr) && | 95 result = ((::Gestalt(gestaltSystemVersionMajor, &major) == noErr) && |
| 96 (::Gestalt(gestaltSystemVersionMinor, &minor) == noErr) && | 96 (::Gestalt(gestaltSystemVersionMinor, &minor) == noErr) && |
| 97 ((major > 10) || (major == 10 && minor >= 6))); | 97 ((major > 10) || (major == 10 && minor >= 6))); |
| 98 isCached = true; | 98 isCached = true; |
| 99 } | 99 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 CGContextAddArcToPoint(context, lx, ty, lx, cy, radius); | 141 CGContextAddArcToPoint(context, lx, ty, lx, cy, radius); |
| 142 CGContextClosePath(context); | 142 CGContextClosePath(context); |
| 143 | 143 |
| 144 if (fill) | 144 if (fill) |
| 145 CGContextFillPath(context); | 145 CGContextFillPath(context); |
| 146 else | 146 else |
| 147 CGContextStrokePath(context); | 147 CGContextStrokePath(context); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace o3d | 150 } // namespace o3d |
| OLD | NEW |