From 8e84a1ed07ad5d529d381d43302e597f31723076 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Tue, 16 Feb 2016 11:09:25 -0800 Subject: 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 --- src/gpu/text/GrTextContext.cpp | 59 ------------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 src/gpu/text/GrTextContext.cpp (limited to 'src/gpu/text/GrTextContext.cpp') 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; -} -- cgit v1.2.3