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 "GrFontScaler.h" | 9 #include "GrFontScaler.h" |
10 | 10 |
11 #include "SkGlyphCache.h" | 11 #include "SkGlyphCache.h" |
12 | 12 |
13 GrTextContext::GrTextContext(GrContext* context, const SkSurfaceProps& surfacePr
ops) | 13 GrTextContext::GrTextContext(GrContext* context) |
14 : fContext(context) | 14 : fContext(context) { |
15 , fSurfaceProps(surfaceProps) { | |
16 } | 15 } |
17 | 16 |
18 bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { | 17 bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { |
19 if (!SkXfermode::AsMode(paint.getXfermode(), nullptr) || | 18 if (!SkXfermode::AsMode(paint.getXfermode(), nullptr) || |
20 paint.getMaskFilter() || | 19 paint.getMaskFilter() || |
21 paint.getRasterizer() || | 20 paint.getRasterizer() || |
22 paint.getPathEffect() || | 21 paint.getPathEffect() || |
23 paint.isFakeBoldText() || | 22 paint.isFakeBoldText() || |
24 paint.getStyle() != SkPaint::kFill_Style) | 23 paint.getStyle() != SkPaint::kFill_Style) |
25 { | 24 { |
(...skipping 29 matching lines...) Expand all Loading... |
55 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 54 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
56 scaler = (GrFontScaler*)auxData; | 55 scaler = (GrFontScaler*)auxData; |
57 } | 56 } |
58 if (nullptr == scaler) { | 57 if (nullptr == scaler) { |
59 scaler = new GrFontScaler(cache); | 58 scaler = new GrFontScaler(cache); |
60 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 59 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
61 } | 60 } |
62 | 61 |
63 return scaler; | 62 return scaler; |
64 } | 63 } |
OLD | NEW |