OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 "GrTextContext.h" | 8 #include "GrTextContext.h" |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 | 10 |
11 #include "SkAutoKern.h" | 11 #include "SkAutoKern.h" |
12 #include "SkGlyphCache.h" | 12 #include "SkGlyphCache.h" |
13 #include "SkGr.h" | 13 #include "GrFontScaler.h" |
14 | 14 |
15 GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& prope
rties) : | 15 GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& prope
rties) : |
16 fContext(context), fDeviceProperties(properties), fD
rawTarget(NULL) { | 16 fContext(context), fDeviceProperties(properties), fD
rawTarget(NULL) { |
17 } | 17 } |
18 | 18 |
19 void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) { | 19 void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) { |
20 const GrClipData* clipData = fContext->getClip(); | 20 const GrClipData* clipData = fContext->getClip(); |
21 | 21 |
22 SkRect devConservativeBound; | 22 SkRect devConservativeBound; |
23 clipData->fClipStack->getConservativeBounds( | 23 clipData->fClipStack->getConservativeBounds( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) { | 64 GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) { |
65 void* auxData; | 65 void* auxData; |
66 GrFontScaler* scaler = NULL; | 66 GrFontScaler* scaler = NULL; |
67 | 67 |
68 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 68 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
69 scaler = (GrFontScaler*)auxData; | 69 scaler = (GrFontScaler*)auxData; |
70 } | 70 } |
71 if (NULL == scaler) { | 71 if (NULL == scaler) { |
72 scaler = SkNEW_ARGS(SkGrFontScaler, (cache)); | 72 scaler = SkNEW_ARGS(GrFontScaler, (cache)); |
73 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 73 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
74 } | 74 } |
75 | 75 |
76 return scaler; | 76 return scaler; |
77 } | 77 } |
OLD | NEW |