skia2/gm/system_preferences_mac.mm
caryclark@google.com 1313086ef4 fix warnings on Mac in gm
Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation

The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6305046

git-svn-id: http://skia.googlecode.com/svn/trunk@4185 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-06 12:10:45 +00:00

30 lines
881 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>
// FIXME: should be in a header
void setSystemPreferences();
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
enum {
NoFontSmoothing = 0,
LightFontSmoothing = 1,
MediumFontSmoothing = 2,
StrongFontSmoothing = 3,
};
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"];
[pool release];
}