OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 return false; | 34 return false; |
35 } | 35 } |
36 | 36 |
37 #ifdef SK_BUILD_FOR_MAC | 37 #ifdef SK_BUILD_FOR_MAC |
38 #import <ApplicationServices/ApplicationServices.h> | 38 #import <ApplicationServices/ApplicationServices.h> |
39 #define BITMAP_INFO_RGB (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Ho
st) | 39 #define BITMAP_INFO_RGB (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Ho
st) |
40 | 40 |
41 static CGContextRef makeCG(const SkImageInfo& info, const void* addr, | 41 static CGContextRef makeCG(const SkImageInfo& info, const void* addr, |
42 size_t rowBytes) { | 42 size_t rowBytes) { |
43 if (kPMColor_SkColorType != info.colorType() || NULL == addr) { | 43 if (kN32_SkColorType != info.colorType() || NULL == addr) { |
44 return NULL; | 44 return NULL; |
45 } | 45 } |
46 CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); | 46 CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); |
47 CGContextRef cg = CGBitmapContextCreate((void*)addr, info.width(), info.heig
ht(), | 47 CGContextRef cg = CGBitmapContextCreate((void*)addr, info.width(), info.heig
ht(), |
48 8, rowBytes, space, BITMAP_INFO_RGB)
; | 48 8, rowBytes, space, BITMAP_INFO_RGB)
; |
49 CFRelease(space); | 49 CFRelease(space); |
50 | 50 |
51 CGContextSetAllowsFontSubpixelQuantization(cg, false); | 51 CGContextSetAllowsFontSubpixelQuantization(cg, false); |
52 CGContextSetShouldSubpixelQuantizeFonts(cg, false); | 52 CGContextSetShouldSubpixelQuantizeFonts(cg, false); |
53 | 53 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 private: | 201 private: |
202 typedef GM INHERITED; | 202 typedef GM INHERITED; |
203 }; | 203 }; |
204 | 204 |
205 ////////////////////////////////////////////////////////////////////////////// | 205 ////////////////////////////////////////////////////////////////////////////// |
206 | 206 |
207 static GM* MyFactory(void*) { return new GammaTextGM; } | 207 static GM* MyFactory(void*) { return new GammaTextGM; } |
208 static GMRegistry reg(MyFactory); | 208 static GMRegistry reg(MyFactory); |
209 | 209 |
210 } | 210 } |
OLD | NEW |