| 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) | |
| 14 : fContext(context) { | |
| 15 } | |
| 16 | |
| 17 bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { | 13 bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { |
| 18 if (!SkXfermode::AsMode(paint.getXfermode(), nullptr) || | 14 if (!SkXfermode::AsMode(paint.getXfermode(), nullptr) || |
| 19 paint.getMaskFilter() || | 15 paint.getMaskFilter() || |
| 20 paint.getRasterizer() || | 16 paint.getRasterizer() || |
| 21 paint.getPathEffect() || | 17 paint.getPathEffect() || |
| 22 paint.isFakeBoldText() || | 18 paint.isFakeBoldText() || |
| 23 paint.getStyle() != SkPaint::kFill_Style) | 19 paint.getStyle() != SkPaint::kFill_Style) |
| 24 { | 20 { |
| 25 return true; | 21 return true; |
| 26 } | 22 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 50 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
| 55 scaler = (GrFontScaler*)auxData; | 51 scaler = (GrFontScaler*)auxData; |
| 56 } | 52 } |
| 57 if (nullptr == scaler) { | 53 if (nullptr == scaler) { |
| 58 scaler = new GrFontScaler(cache); | 54 scaler = new GrFontScaler(cache); |
| 59 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 55 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
| 60 } | 56 } |
| 61 | 57 |
| 62 return scaler; | 58 return scaler; |
| 63 } | 59 } |
| OLD | NEW |