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 "GrBlurUtils.h" | 9 #include "GrBlurUtils.h" |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 textContext = textContext->fFallbackTextContext; | 73 textContext = textContext->fFallbackTextContext; |
74 } while (textContext); | 74 } while (textContext); |
75 | 75 |
76 // fall back to drawing as a path | 76 // fall back to drawing as a path |
77 this->drawPosTextAsPath(dc, rt, clip, skPaint, viewMatrix, text, byteLength,
pos, | 77 this->drawPosTextAsPath(dc, rt, clip, skPaint, viewMatrix, text, byteLength,
pos, |
78 scalarsPerPosition, offset, clipBounds); | 78 scalarsPerPosition, offset, clipBounds); |
79 } | 79 } |
80 | 80 |
81 bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { | 81 bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { |
82 if (paint.getShader() || | 82 if (!SkXfermode::AsMode(paint.getXfermode(), nullptr) || |
83 !SkXfermode::AsMode(paint.getXfermode(), nullptr) || | |
84 paint.getMaskFilter() || | 83 paint.getMaskFilter() || |
85 paint.getRasterizer() || | 84 paint.getRasterizer() || |
86 paint.getColorFilter() || | |
87 paint.getPathEffect() || | 85 paint.getPathEffect() || |
88 paint.isFakeBoldText() || | 86 paint.isFakeBoldText() || |
89 paint.getStyle() != SkPaint::kFill_Style) | 87 paint.getStyle() != SkPaint::kFill_Style) |
90 { | 88 { |
91 return true; | 89 return true; |
92 } | 90 } |
93 return false; | 91 return false; |
94 } | 92 } |
95 | 93 |
96 uint32_t GrTextContext::FilterTextFlags(const SkSurfaceProps& surfaceProps, cons
t SkPaint& paint) { | 94 uint32_t GrTextContext::FilterTextFlags(const SkSurfaceProps& surfaceProps, cons
t SkPaint& paint) { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 269 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
272 scaler = (GrFontScaler*)auxData; | 270 scaler = (GrFontScaler*)auxData; |
273 } | 271 } |
274 if (nullptr == scaler) { | 272 if (nullptr == scaler) { |
275 scaler = new GrFontScaler(cache); | 273 scaler = new GrFontScaler(cache); |
276 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 274 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
277 } | 275 } |
278 | 276 |
279 return scaler; | 277 return scaler; |
280 } | 278 } |
OLD | NEW |