aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrTextContext.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-02-16 11:09:25 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 11:09:25 -0800
commit8e84a1ed07ad5d529d381d43302e597f31723076 (patch)
tree7ec66370a27dc047a86fb5501ef0c81d8718ac82 /src/gpu/text/GrTextContext.cpp
parent546d66544bcfac4bc9e77626ba549c4b3a79a654 (diff)
Delete GrTextContext
Diffstat (limited to 'src/gpu/text/GrTextContext.cpp')
-rw-r--r--src/gpu/text/GrTextContext.cpp59
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;
-}