Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Unified Diff: src/gpu/text/GrTextContext.cpp

Issue 1699073004: Delete GrTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@sever-the-cord
Patch Set: nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/text/GrTextContext.h ('k') | src/gpu/text/GrTextUtils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrTextContext.cpp
diff --git a/src/gpu/text/GrTextContext.cpp b/src/gpu/text/GrTextContext.cpp
deleted file mode 100644
index 1e2d290e908399cc8c7549be74d6b942bb881539..0000000000000000000000000000000000000000
--- 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;
-}
« no previous file with comments | « src/gpu/text/GrTextContext.h ('k') | src/gpu/text/GrTextUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698