blob: ff5905fc1ece055e16941ff61b1df9f7c948c661 [file] [log] [blame]
reed@android.com0680d6c2008-12-19 19:46:15 +00001/*
reed@android.com8a1c16f2008-12-17 15:59:43 +00002 ** Copyright 2006, The Android Open Source Project
reed@android.com0680d6c2008-12-19 19:46:15 +00003 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15*/
16
reed@android.comf13c6e12009-01-19 19:10:24 +000017#include <carbon/carbon.h>
reed@android.com0680d6c2008-12-19 19:46:15 +000018#include "SkFontHost.h"
19#include "SkDescriptor.h"
reed@android.com0bf64d42009-03-09 17:22:22 +000020#include "SkEndian.h"
reed@android.comf13c6e12009-01-19 19:10:24 +000021#include "SkPoint.h"
reed@android.com0680d6c2008-12-19 19:46:15 +000022
23// Give 1MB font cache budget
24#define FONT_CACHE_MEMORY_BUDGET (1024 * 1024)
25
26const char* gDefaultfont = "Arial"; // hard code for now
27static SkMutex gFTMutex;
28
reed@android.com03ca3d12008-12-22 15:35:46 +000029static inline SkPoint F32PtToSkPoint(const Float32Point p) {
30 SkPoint sp = { SkFloatToScalar(p.x), SkFloatToScalar(p.y) };
reed@android.com0680d6c2008-12-19 19:46:15 +000031 return sp;
32}
33
reed@android.com03ca3d12008-12-22 15:35:46 +000034static inline uint32_t _rotl(uint32_t v, uint32_t r) {
reed@android.com0680d6c2008-12-19 19:46:15 +000035 return (v << r | v >> (32 - r));
36}
37
reed@android.com0680d6c2008-12-19 19:46:15 +000038class SkTypeface_Mac : public SkTypeface {
39public:
reed@android.comea446b92009-03-09 15:25:11 +000040 SkTypeface_Mac(SkTypeface::Style style, uint32_t id)
41 : SkTypeface(style, id) {}
reed@android.com0680d6c2008-12-19 19:46:15 +000042};
43
44#pragma mark -
45
reed@android.comea446b92009-03-09 15:25:11 +000046static uint32_t find_from_name(const char name[]) {
47 CFStringRef str = CFStringCreateWithCString(NULL, name,
48 kCFStringEncodingUTF8);
49 uint32_t fontID = ::ATSFontFindFromName(str, kATSOptionFlagsDefault);
50 CFRelease(str);
51 return fontID;
reed@android.com0680d6c2008-12-19 19:46:15 +000052}
53
reed@android.comea446b92009-03-09 15:25:11 +000054static uint32_t find_default_fontID() {
55 static const char* gDefaultNames[] = { "Arial", "Tahoma", "Helvetica" };
reed@android.com0680d6c2008-12-19 19:46:15 +000056
reed@android.comea446b92009-03-09 15:25:11 +000057 uint32_t fontID;
58 for (size_t i = 0; i < SK_ARRAY_COUNT(gDefaultNames); i++) {
59 fontID = find_from_name(gDefaultNames[i]);
60 if (fontID) {
61 return fontID;
reed@android.com0680d6c2008-12-19 19:46:15 +000062 }
reed@android.com0680d6c2008-12-19 19:46:15 +000063 }
reed@android.comea446b92009-03-09 15:25:11 +000064 sk_throw();
65 return 0;
66}
67
68static SkTypeface* CreateTypeface_(const char name[], SkTypeface::Style style) {
69 uint32_t fontID = 0;
70 if (NULL != name) {
71 fontID = find_from_name(name);
72 }
73 if (0 == fontID) {
74 fontID = find_default_fontID();
75 }
76 // we lie (for now) and report that we found the exact style bits
77 return new SkTypeface_Mac(style, fontID);
reed@android.com0680d6c2008-12-19 19:46:15 +000078}
79
80#pragma mark -
81
82class SkScalerContext_Mac : public SkScalerContext {
83public:
84 SkScalerContext_Mac(const SkDescriptor* desc);
85 virtual ~SkScalerContext_Mac();
86
87protected:
88 virtual unsigned generateGlyphCount() const;
89 virtual uint16_t generateCharToGlyph(SkUnichar uni);
90 virtual void generateAdvance(SkGlyph* glyph);
91 virtual void generateMetrics(SkGlyph* glyph);
92 virtual void generateImage(const SkGlyph& glyph);
93 virtual void generatePath(const SkGlyph& glyph, SkPath* path);
reed@android.com0680d6c2008-12-19 19:46:15 +000094 virtual void generateFontMetrics(SkPaint::FontMetrics* mX, SkPaint::FontMetrics* mY);
reed@android.com0680d6c2008-12-19 19:46:15 +000095
96private:
97 ATSUTextLayout fLayout;
98 ATSUStyle fStyle;
reed@android.com76aa34b2008-12-23 01:27:39 +000099 CGColorSpaceRef fGrayColorSpace;
reed@android.com0bf64d42009-03-09 17:22:22 +0000100 CGAffineTransform fTransform;
reed@android.com0680d6c2008-12-19 19:46:15 +0000101
102 static OSStatus MoveTo(const Float32Point *pt, void *cb);
103 static OSStatus Line(const Float32Point *pt, void *cb);
104 static OSStatus Curve(const Float32Point *pt1, const Float32Point *pt2, const Float32Point *pt3, void *cb);
105 static OSStatus Close(void *cb);
106};
107
108SkScalerContext_Mac::SkScalerContext_Mac(const SkDescriptor* desc)
reed@android.com0bf64d42009-03-09 17:22:22 +0000109 : SkScalerContext(desc), fLayout(0), fStyle(0)
110{
reed@android.com0680d6c2008-12-19 19:46:15 +0000111 SkAutoMutexAcquire ac(gFTMutex);
112 OSStatus err;
113
reed@android.comea446b92009-03-09 15:25:11 +0000114 err = ::ATSUCreateStyle(&fStyle);
115 SkASSERT(0 == err);
reed@android.com0bf64d42009-03-09 17:22:22 +0000116
117 SkMatrix m;
118 fRec.getSingleMatrix(&m);
119
120 fTransform = CGAffineTransformMake(SkScalarToFloat(m[SkMatrix::kMScaleX]),
121 SkScalarToFloat(m[SkMatrix::kMSkewX]),
122 SkScalarToFloat(m[SkMatrix::kMSkewY]),
123 SkScalarToFloat(m[SkMatrix::kMScaleY]),
124 SkScalarToFloat(m[SkMatrix::kMTransX]),
125 SkScalarToFloat(m[SkMatrix::kMTransY]));
126
reed@android.com590ef3f2009-03-10 04:02:30 +0000127 ATSStyleRenderingOptions renderOpts = kATSStyleApplyAntiAliasing;
128 switch (fRec.fHints) {
129 case kNo_Hints:
130 renderOpts |= kATSStyleNoHinting;
131 break;
132 case kSubpixel_Hints:
133 // hmmm, need to support subpixel... from path?
134 renderOpts |= kATSStyleNoHinting;
135 break;
136 case kNormal_Hints:
137 renderOpts |= kATSStyleApplyHints;
138 break;
139 }
140
141 ATSUFontID fontID = FMGetFontFromATSFontRef(fRec.fFontID);
142 // we put everything in the matrix, so our pt size is just 1.0
143 Fixed fixedSize = SK_Fixed1;
144 static const ATSUAttributeTag tags[] = {
145 kATSUFontTag, kATSUSizeTag, kATSUFontMatrixTag, kATSUStyleRenderingOptionsTag
146 };
147 static const ByteCount sizes[] = {
148 sizeof(fontID), sizeof(fixedSize), sizeof(fTransform), sizeof(renderOpts)
149 };
150 const ATSUAttributeValuePtr values[] = {
151 &fontID, &fixedSize, &fTransform, &renderOpts
152 };
reed@android.com0bf64d42009-03-09 17:22:22 +0000153 err = ::ATSUSetAttributes(fStyle, SK_ARRAY_COUNT(tags),
154 tags, sizes, values);
reed@android.comea446b92009-03-09 15:25:11 +0000155 SkASSERT(0 == err);
reed@android.com0680d6c2008-12-19 19:46:15 +0000156
157 err = ::ATSUCreateTextLayout(&fLayout);
reed@android.comea446b92009-03-09 15:25:11 +0000158 SkASSERT(0 == err);
reed@android.com76aa34b2008-12-23 01:27:39 +0000159
160 fGrayColorSpace = ::CGColorSpaceCreateDeviceGray();
reed@android.com0680d6c2008-12-19 19:46:15 +0000161}
162
reed@android.comea446b92009-03-09 15:25:11 +0000163SkScalerContext_Mac::~SkScalerContext_Mac() {
reed@android.com76aa34b2008-12-23 01:27:39 +0000164 ::CGColorSpaceRelease(fGrayColorSpace);
reed@android.com0680d6c2008-12-19 19:46:15 +0000165 ::ATSUDisposeTextLayout(fLayout);
166 ::ATSUDisposeStyle(fStyle);
167}
168
reed@android.comea446b92009-03-09 15:25:11 +0000169unsigned SkScalerContext_Mac::generateGlyphCount() const {
reed@android.com0680d6c2008-12-19 19:46:15 +0000170 return 0xFFFF;
171}
172
173uint16_t SkScalerContext_Mac::generateCharToGlyph(SkUnichar uni)
174{
175 SkAutoMutexAcquire ac(gFTMutex);
176
177 OSStatus err;
178 UniChar achar = uni;
179 err = ::ATSUSetTextPointerLocation(fLayout,&achar,0,1,1);
180 err = ::ATSUSetRunStyle(fLayout,fStyle,kATSUFromTextBeginning,kATSUToTextEnd);
181
182 ATSLayoutRecord *layoutPtr;
183 ItemCount count;
184 ATSGlyphRef glyph;
185
186 err = ::ATSUDirectGetLayoutDataArrayPtrFromTextLayout(fLayout,0,kATSUDirectDataLayoutRecordATSLayoutRecordCurrent,(void**)&layoutPtr,&count);
187 glyph = layoutPtr->glyphID;
188 ::ATSUDirectReleaseLayoutDataArrayPtr(NULL,kATSUDirectDataLayoutRecordATSLayoutRecordCurrent,(void**)&layoutPtr);
189 return glyph;
190}
191
reed@android.com76aa34b2008-12-23 01:27:39 +0000192static void set_glyph_metrics_on_error(SkGlyph* glyph) {
193 glyph->fRsbDelta = 0;
194 glyph->fLsbDelta = 0;
195 glyph->fWidth = 0;
196 glyph->fHeight = 0;
197 glyph->fTop = 0;
198 glyph->fLeft = 0;
199 glyph->fAdvanceX = 0;
200 glyph->fAdvanceY = 0;
201}
202
reed@android.com0680d6c2008-12-19 19:46:15 +0000203void SkScalerContext_Mac::generateAdvance(SkGlyph* glyph) {
204 this->generateMetrics(glyph);
205}
206
reed@android.com76aa34b2008-12-23 01:27:39 +0000207void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
208 GlyphID glyphID = glyph->getGlyphID(fBaseGlyphCount);
reed@android.com330578d2009-03-09 18:12:13 +0000209 ATSGlyphScreenMetrics screenMetrics;
210 ATSGlyphIdealMetrics idealMetrics;
reed@android.com76aa34b2008-12-23 01:27:39 +0000211
212 OSStatus err = ATSUGlyphGetScreenMetrics(fStyle, 1, &glyphID, 0, true, true,
reed@android.com330578d2009-03-09 18:12:13 +0000213 &screenMetrics);
reed@android.com76aa34b2008-12-23 01:27:39 +0000214 if (noErr != err) {
215 set_glyph_metrics_on_error(glyph);
reed@android.com330578d2009-03-09 18:12:13 +0000216 return;
reed@android.com0680d6c2008-12-19 19:46:15 +0000217 }
reed@android.com330578d2009-03-09 18:12:13 +0000218 err = ATSUGlyphGetIdealMetrics(fStyle, 1, &glyphID, 0, &idealMetrics);
219 if (noErr != err) {
220 set_glyph_metrics_on_error(glyph);
221 return;
222 }
reed@android.com590ef3f2009-03-10 04:02:30 +0000223
reed@android.com330578d2009-03-09 18:12:13 +0000224 if (kNormal_Hints == fRec.fHints) {
225 glyph->fAdvanceX = SkFloatToFixed(screenMetrics.deviceAdvance.x);
226 glyph->fAdvanceY = -SkFloatToFixed(screenMetrics.deviceAdvance.y);
227 } else {
228 glyph->fAdvanceX = SkFloatToFixed(idealMetrics.advance.x);
229 glyph->fAdvanceY = -SkFloatToFixed(idealMetrics.advance.y);
230 }
231
232 // specify an extra 1-pixel border, go tive CG room for its antialiasing
233 // i.e. without this, I was seeing some edges chopped off!
234 glyph->fWidth = screenMetrics.width + 2;
235 glyph->fHeight = screenMetrics.height + 2;
236 glyph->fLeft = sk_float_round2int(screenMetrics.topLeft.x) - 1;
237 glyph->fTop = -sk_float_round2int(screenMetrics.topLeft.y) - 1;
238}
239
240void SkScalerContext_Mac::generateImage(const SkGlyph& glyph)
241{
242 SkAutoMutexAcquire ac(gFTMutex);
243 SkASSERT(fLayout);
244
245 bzero(glyph.fImage, glyph.fHeight * glyph.rowBytes());
246 CGContextRef contextRef = ::CGBitmapContextCreate(glyph.fImage,
247 glyph.fWidth, glyph.fHeight, 8,
248 glyph.rowBytes(), fGrayColorSpace,
249 kCGImageAlphaNone);
250 if (!contextRef) {
251 SkASSERT(false);
252 return;
253 }
254
255 ::CGContextSetGrayFillColor(contextRef, 1.0, 1.0);
256 ::CGContextSetTextDrawingMode(contextRef, kCGTextFill);
257
reed@android.com590ef3f2009-03-10 04:02:30 +0000258 CGGlyph glyphID = glyph.getGlyphID(fBaseGlyphCount);
reed@android.com330578d2009-03-09 18:12:13 +0000259 CGFontRef fontRef = CGFontCreateWithPlatformFont(&fRec.fFontID);
260 CGContextSetFont(contextRef, fontRef);
261 CGContextSetFontSize(contextRef, 1);
262 CGContextSetTextMatrix(contextRef, fTransform);
263 CGContextShowGlyphsAtPoint(contextRef, -glyph.fLeft,
264 glyph.fTop + glyph.fHeight, &glyphID, 1);
265
266 ::CGContextRelease(contextRef);
reed@android.com0680d6c2008-12-19 19:46:15 +0000267}
268
reed@android.com0bf64d42009-03-09 17:22:22 +0000269static void convert_metrics(SkPaint::FontMetrics* dst,
270 const ATSFontMetrics& src) {
271 dst->fTop = -SkFloatToScalar(src.ascent);
272 dst->fAscent = -SkFloatToScalar(src.ascent);
273 dst->fDescent = SkFloatToScalar(src.descent);
274 dst->fBottom = SkFloatToScalar(src.descent);
275 dst->fLeading = SkFloatToScalar(src.leading);
276}
277
278static void* get_font_table(ATSFontRef fontID, uint32_t tag) {
279 ByteCount size;
280 OSStatus err = ATSFontGetTable(fontID, tag, 0, 0, NULL, &size);
281 if (err) {
282 return NULL;
283 }
284 void* data = sk_malloc_throw(size);
285 err = ATSFontGetTable(fontID, tag, 0, size, data, &size);
286 if (err) {
287 sk_free(data);
288 data = NULL;
289 }
290 return data;
291}
292
293static int get_be16(const void* data, size_t offset) {
294 const char* ptr = reinterpret_cast<const char*>(data);
295 uint16_t value = *reinterpret_cast<const uint16_t*>(ptr + offset);
296 int n = SkEndian_SwapBE16(value);
297 // now force it to be signed
298 return n << 16 >> 16;
299}
300
301#define SFNT_HEAD_UPEM_OFFSET 18
302#define SFNT_HEAD_YMIN_OFFSET 38
303#define SFNT_HEAD_YMAX_OFFSET 42
304#define SFNT_HEAD_STYLE_OFFSET 44
305
306#define SFNT_HHEA_ASCENT_OFFSET 4
307#define SFNT_HHEA_DESCENT_OFFSET 6
308#define SFNT_HHEA_LEADING_OFFSET 8
309
310static bool init_vertical_metrics(ATSFontRef font, SkPoint pts[5]) {
311 void* head = get_font_table(font, 'head');
312 if (NULL == head) {
313 return false;
314 }
315 void* hhea = get_font_table(font, 'hhea');
316 if (NULL == hhea) {
317 sk_free(head);
318 return false;
319 }
320
321 int upem = get_be16(head, SFNT_HEAD_UPEM_OFFSET);
322 int ys[5];
323
324 ys[0] = -get_be16(head, SFNT_HEAD_YMAX_OFFSET);
325 ys[1] = -get_be16(hhea, SFNT_HHEA_ASCENT_OFFSET);
326 ys[2] = -get_be16(hhea, SFNT_HHEA_DESCENT_OFFSET);
327 ys[3] = -get_be16(head, SFNT_HEAD_YMIN_OFFSET);
328 ys[4] = get_be16(hhea, SFNT_HHEA_LEADING_OFFSET);
329
330 // now do some cleanup, to ensure y[max,min] are really that
331 if (ys[0] > ys[1]) {
332 ys[0] = ys[1];
333 }
334 if (ys[3] < ys[2]) {
335 ys[3] = ys[2];
336 }
337
338 for (int i = 0; i < 5; i++) {
339 pts[i].set(0, SkIntToScalar(ys[i]) / upem);
340 }
341
342 sk_free(hhea);
343 sk_free(head);
344 return true;
345}
346
reed@android.com76aa34b2008-12-23 01:27:39 +0000347void SkScalerContext_Mac::generateFontMetrics(SkPaint::FontMetrics* mx,
348 SkPaint::FontMetrics* my) {
reed@android.com0bf64d42009-03-09 17:22:22 +0000349 SkPoint pts[5];
350
351 if (!init_vertical_metrics(fRec.fFontID, pts)) {
352 // these are not as accurate as init_vertical_metrics :(
353 ATSFontMetrics metrics;
354 ATSFontGetVerticalMetrics(fRec.fFontID, kATSOptionFlagsDefault,
355 &metrics);
356 pts[0].set(0, -SkFloatToScalar(metrics.ascent));
357 pts[1].set(0, -SkFloatToScalar(metrics.ascent));
358 pts[2].set(0, -SkFloatToScalar(metrics.descent));
359 pts[3].set(0, -SkFloatToScalar(metrics.descent));
360 pts[4].set(0, SkFloatToScalar(metrics.leading)); //+ or -?
361 }
362
363 SkMatrix m;
364 fRec.getSingleMatrix(&m);
365 m.mapPoints(pts, 5);
366
367 if (mx) {
368 mx->fTop = pts[0].fX;
369 mx->fAscent = pts[1].fX;
370 mx->fDescent = pts[2].fX;
371 mx->fBottom = pts[3].fX;
372 mx->fLeading = pts[4].fX;
373 }
374 if (my) {
375 my->fTop = pts[0].fY;
376 my->fAscent = pts[1].fY;
377 my->fDescent = pts[2].fY;
378 my->fBottom = pts[3].fY;
379 my->fLeading = pts[4].fY;
380 }
reed@android.com0680d6c2008-12-19 19:46:15 +0000381}
382
reed@android.com0680d6c2008-12-19 19:46:15 +0000383void SkScalerContext_Mac::generatePath(const SkGlyph& glyph, SkPath* path)
384{
385 SkAutoMutexAcquire ac(gFTMutex);
386 OSStatus err,result;
387
388 err = ::ATSUGlyphGetCubicPaths(
389 fStyle,glyph.fID,
390 &SkScalerContext_Mac::MoveTo,
391 &SkScalerContext_Mac::Line,
392 &SkScalerContext_Mac::Curve,
393 &SkScalerContext_Mac::Close,
394 path,&result);
395 SkASSERT(err == noErr);
396}
397
reed@android.com0680d6c2008-12-19 19:46:15 +0000398OSStatus SkScalerContext_Mac::MoveTo(const Float32Point *pt, void *cb)
399{
400 reinterpret_cast<SkPath*>(cb)->moveTo(F32PtToSkPoint(*pt));
401 return noErr;
402}
403
404OSStatus SkScalerContext_Mac::Line(const Float32Point *pt, void *cb)
405{
406 reinterpret_cast<SkPath*>(cb)->lineTo(F32PtToSkPoint(*pt));
407 return noErr;
408}
409
reed@android.com03ca3d12008-12-22 15:35:46 +0000410OSStatus SkScalerContext_Mac::Curve(const Float32Point *pt1,
411 const Float32Point *pt2,
412 const Float32Point *pt3, void *cb)
reed@android.com0680d6c2008-12-19 19:46:15 +0000413{
reed@android.com03ca3d12008-12-22 15:35:46 +0000414 reinterpret_cast<SkPath*>(cb)->cubicTo(F32PtToSkPoint(*pt1),
415 F32PtToSkPoint(*pt2),
416 F32PtToSkPoint(*pt3));
reed@android.com0680d6c2008-12-19 19:46:15 +0000417 return noErr;
418}
419
420OSStatus SkScalerContext_Mac::Close(void *cb)
421{
422 reinterpret_cast<SkPath*>(cb)->close();
423 return noErr;
424}
425
426#pragma mark -
427
428void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) {
429 SkASSERT(!"SkFontHost::Serialize unimplemented");
430}
431
432SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
433 SkASSERT(!"SkFontHost::Deserialize unimplemented");
434 return NULL;
435}
436
reed@android.comb1d9d2e2009-03-04 17:37:51 +0000437SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
reed@android.comea446b92009-03-09 15:25:11 +0000438 return NULL;
reed@android.com0680d6c2008-12-19 19:46:15 +0000439}
440
reed@android.com03ca3d12008-12-22 15:35:46 +0000441SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) {
reed@android.comea446b92009-03-09 15:25:11 +0000442 return NULL;
reed@android.com03ca3d12008-12-22 15:35:46 +0000443}
444
reed@android.comea446b92009-03-09 15:25:11 +0000445SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) {
reed@android.com0680d6c2008-12-19 19:46:15 +0000446 return new SkScalerContext_Mac(desc);
447}
448
reed@android.coma14ea0e2009-03-17 17:59:53 +0000449uint32_t SkFontHost::NextLogicalFont(uint32_t fontID) {
450 uint32_t newFontID = find_default_fontID();
451 if (newFontID == fontID) {
452 newFontID = 0;
453 }
454 return newFontID;
reed@android.com0680d6c2008-12-19 19:46:15 +0000455}
456
reed@android.comb1d9d2e2009-03-04 17:37:51 +0000457SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
458 const char familyName[], SkTypeface::Style style) {
reed@android.comea446b92009-03-09 15:25:11 +0000459 // todo: we don't know how to respect style bits
460 if (NULL == familyName && NULL != familyFace) {
461 familyFace->ref();
462 return const_cast<SkTypeface*>(familyFace);
463 } else {
464 return CreateTypeface_(familyName, style);
reed@android.com0680d6c2008-12-19 19:46:15 +0000465 }
reed@android.com0680d6c2008-12-19 19:46:15 +0000466}
467
468size_t SkFontHost::ShouldPurgeFontCache(size_t sizeAllocatedSoFar) {
469 if (sizeAllocatedSoFar > FONT_CACHE_MEMORY_BUDGET)
470 return sizeAllocatedSoFar - FONT_CACHE_MEMORY_BUDGET;
471 else
472 return 0; // nothing to do
473}
474
475int SkFontHost::ComputeGammaFlag(const SkPaint& paint) {
476 return 0;
477}
478
479void SkFontHost::GetGammaTables(const uint8_t* tables[2]) {
480 tables[0] = NULL; // black gamma (e.g. exp=1.4)
481 tables[1] = NULL; // white gamma (e.g. exp= 1/1.4)
482}
483