skia2/gm/system_preferences_mac.mm
epoger@google.com 7bc13a6260 Set LCD font smoothing to "medium" for gm on Mac, regardless of system settings
http://code.google.com/p/skia/issues/detail?id=382 ('make gm results consistent regardless of system LCDtext settings')
Review URL: https://codereview.appspot.com/5661043

git-svn-id: http://skia.googlecode.com/svn/trunk@3184 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-02-14 14:53:59 +00:00

25 lines
853 B
Plaintext

/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#import <Cocoa/Cocoa.h>
void setSystemPreferences() {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Set LCD font smoothing level for this application (does not affect other
// applications). Based on resetDefaultsToConsistentValues() in
// http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
static const int NoFontSmoothing = 0;
static const int LightFontSmoothing = 1;
static const int MediumFontSmoothing = 2;
static const int StrongFontSmoothing = 3;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"];
[pool release];
}