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/logging.h" | 5 #include "base/logging.h" |
6 #include "content/shell/webkit_test_platform_support.h" | 6 #include "content/shell/webkit_test_platform_support.h" |
7 | 7 |
8 #include <AppKit/AppKit.h> | 8 #include <AppKit/AppKit.h> |
9 #include <Foundation/Foundation.h> | 9 #include <Foundation/Foundation.h> |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 void SetDefaultsToLayoutTestValues(void) { | 15 void SetDefaultsToLayoutTestValues(void) { |
16 // So we can match the WebKit layout tests, we want to force a bunch of | 16 // So we can match the WebKit layout tests, we want to force a bunch of |
17 // preferences that control appearance to match. | 17 // preferences that control appearance to match. |
18 // (We want to do this as early as possible in application startup so | 18 // (We want to do this as early as possible in application startup so |
19 // the settings are in before any higher layers could cache values.) | 19 // the settings are in before any higher layers could cache values.) |
20 | 20 |
21 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | 21 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; |
22 | 22 // Do not set text-rendering prefs (AppleFontSmoothing, |
23 const NSInteger kMinFontSizeCGSmoothes = 4; | 23 // AppleAntiAliasingThreshold) here: Skia picks the right settings for this |
24 const NSInteger kNoFontSmoothing = 0; | 24 // in layout test mode, see FontSkia.cpp in WebKit and |
| 25 // SkFontHost_mac_coretext.cpp in skia. |
25 const NSInteger kBlueTintedAppearance = 1; | 26 const NSInteger kBlueTintedAppearance = 1; |
26 [defaults setInteger:kMinFontSizeCGSmoothes | |
27 forKey:@"AppleAntiAliasingThreshold"]; | |
28 [defaults setInteger:kNoFontSmoothing | |
29 forKey:@"AppleFontSmoothing"]; | |
30 [defaults setInteger:kBlueTintedAppearance | 27 [defaults setInteger:kBlueTintedAppearance |
31 forKey:@"AppleAquaColorVariant"]; | 28 forKey:@"AppleAquaColorVariant"]; |
32 [defaults setObject:@"0.709800 0.835300 1.000000" | 29 [defaults setObject:@"0.709800 0.835300 1.000000" |
33 forKey:@"AppleHighlightColor"]; | 30 forKey:@"AppleHighlightColor"]; |
34 [defaults setObject:@"0.500000 0.500000 0.500000" | 31 [defaults setObject:@"0.500000 0.500000 0.500000" |
35 forKey:@"AppleOtherHighlightColor"]; | 32 forKey:@"AppleOtherHighlightColor"]; |
36 [defaults setObject:[NSArray arrayWithObject:@"en"] | 33 [defaults setObject:[NSArray arrayWithObject:@"en"] |
37 forKey:@"AppleLanguages"]; | 34 forKey:@"AppleLanguages"]; |
38 } | 35 } |
39 | 36 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 kCTFontManagerScopeProcess, | 76 kCTFontManagerScopeProcess, |
80 &errors)) { | 77 &errors)) { |
81 DLOG(FATAL) << "Fail to activate fonts."; | 78 DLOG(FATAL) << "Fail to activate fonts."; |
82 CFRelease(errors); | 79 CFRelease(errors); |
83 } | 80 } |
84 | 81 |
85 return true; | 82 return true; |
86 } | 83 } |
87 | 84 |
88 } // namespace | 85 } // namespace |
OLD | NEW |