diff options
author | joshualitt <joshualitt@chromium.org> | 2016-02-16 11:09:25 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-16 11:09:25 -0800 |
commit | 8e84a1ed07ad5d529d381d43302e597f31723076 (patch) | |
tree | 7ec66370a27dc047a86fb5501ef0c81d8718ac82 /src/gpu/text/GrTextContext.cpp | |
parent | 546d66544bcfac4bc9e77626ba549c4b3a79a654 (diff) |
Delete GrTextContext
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1699073004
Review URL: https://codereview.chromium.org/1699073004
Diffstat (limited to 'src/gpu/text/GrTextContext.cpp')
-rw-r--r-- | src/gpu/text/GrTextContext.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/gpu/text/GrTextContext.cpp b/src/gpu/text/GrTextContext.cpp deleted file mode 100644 index 1e2d290e90..0000000000 --- a/src/gpu/text/GrTextContext.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "GrTextContext.h" -#include "GrFontScaler.h" - -#include "SkGlyphCache.h" - -bool GrTextContext::ShouldDisableLCD(const SkPaint& paint) { - if (!SkXfermode::AsMode(paint.getXfermode(), nullptr) || - paint.getMaskFilter() || - paint.getRasterizer() || - paint.getPathEffect() || - paint.isFakeBoldText() || - paint.getStyle() != SkPaint::kFill_Style) - { - return true; - } - return false; -} - -uint32_t GrTextContext::FilterTextFlags(const SkSurfaceProps& surfaceProps, const SkPaint& paint) { - uint32_t flags = paint.getFlags(); - - if (!paint.isLCDRenderText() || !paint.isAntiAlias()) { - return flags; - } - - if (kUnknown_SkPixelGeometry == surfaceProps.pixelGeometry() || ShouldDisableLCD(paint)) { - flags &= ~SkPaint::kLCDRenderText_Flag; - flags |= SkPaint::kGenA8FromLCD_Flag; - } - - return flags; -} - -static void GlyphCacheAuxProc(void* data) { - GrFontScaler* scaler = (GrFontScaler*)data; - SkSafeUnref(scaler); -} - -GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) { - void* auxData; - GrFontScaler* scaler = nullptr; - - if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { - scaler = (GrFontScaler*)auxData; - } - if (nullptr == scaler) { - scaler = new GrFontScaler(cache); - cache->setAuxProc(GlyphCacheAuxProc, scaler); - } - - return scaler; -} |