From f077324e1317fe2825c8a7969bf159b4efed2ba5 Mon Sep 17 00:00:00 2001 From: bungeman Date: Tue, 10 May 2016 14:32:07 -0700 Subject: [PATCH] Remove SkFontHost.h. What is left of this file is now in SkFontLCDConfig.h. Review-Url: https://codereview.chromium.org/1945883002 --- gyp/core.gypi | 4 +- include/core/SkFontHost.h | 95 ------------------- .../{SkFontHost.cpp => SkFontLCDConfig.cpp} | 21 ---- 3 files changed, 2 insertions(+), 118 deletions(-) delete mode 100644 include/core/SkFontHost.h rename src/core/{SkFontHost.cpp => SkFontLCDConfig.cpp} (50%) diff --git a/gyp/core.gypi b/gyp/core.gypi index 946aa33066..0face28599 100644 --- a/gyp/core.gypi +++ b/gyp/core.gypi @@ -126,7 +126,7 @@ '<(skia_src_path)/core/SkFlattenableSerialization.cpp', '<(skia_src_path)/core/SkFloatBits.cpp', '<(skia_src_path)/core/SkFont.cpp', - '<(skia_src_path)/core/SkFontHost.cpp', + '<(skia_src_path)/core/SkFontLCDConfig.cpp', '<(skia_src_path)/core/SkFontMgr.cpp', '<(skia_src_path)/core/SkFontStyle.cpp', '<(skia_src_path)/core/SkFontDescriptor.cpp', @@ -363,7 +363,7 @@ '<(skia_include_path)/core/SkError.h', '<(skia_include_path)/core/SkFlattenable.h', '<(skia_include_path)/core/SkFlattenableSerialization.h', - '<(skia_include_path)/core/SkFontHost.h', + '<(skia_include_path)/core/SkFontLCDConfig.h', '<(skia_include_path)/core/SkFontStyle.h', '<(skia_include_path)/core/SkGraphics.h', '<(skia_include_path)/core/SkImage.h', diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h deleted file mode 100644 index a2cc04bc70..0000000000 --- a/include/core/SkFontHost.h +++ /dev/null @@ -1,95 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkFontHost_DEFINED -#define SkFontHost_DEFINED - -#include "SkTypeface.h" - -class SkDescriptor; -class SkScalerContext; -struct SkScalerContextRec; -class SkStream; -class SkWStream; - -/** \class SkFontHost - - This class is ported to each environment. It is responsible for bridging - the gap between the (sort of) abstract class SkTypeface and the - platform-specific implementation that provides access to font files. - - One basic task is for each create (subclass of) SkTypeface, the FontHost is - responsible for assigning a uniqueID. The ID should be unique for the - underlying font file/data, not unique per typeface instance. Thus it is - possible/common to request a typeface for the same font more than once - (e.g. asking for the same font by name several times). The FontHost may - return seperate typeface instances in that case, or it may choose to use a - cache and return the same instance (but calling typeface->ref(), since the - caller is always responsible for calling unref() on each instance that is - returned). Either way, the fontID for those instance(s) will be the same. - In addition, the fontID should never be set to 0. That value is used as a - sentinel to indicate no-font-id. - - The major aspects are: - 1) Given either a name/style, return a subclass of SkTypeface that - references the closest matching font available on the host system. - 2) Given the data for a font (either in a stream or a file name), return - a typeface that allows access to that data. - 3) Each typeface instance carries a 32bit ID for its corresponding font. - SkFontHost turns that ID into a stream to access the font's data. - 4) Given a font ID, return a subclass of SkScalerContext, which connects a - font scaler (e.g. freetype or other) to the font's data. - 5) Utilites to manage the font cache (budgeting) and gamma correction -*/ -class SK_API SkFontHost { -public: - /** LCDs either have their color elements arranged horizontally or - vertically. When rendering subpixel glyphs we need to know which way - round they are. - - Note, if you change this after startup, you'll need to flush the glyph - cache because it'll have the wrong type of masks cached. - - @deprecated use SkPixelGeometry instead. - */ - enum LCDOrientation { - kHorizontal_LCDOrientation = 0, //!< this is the default - kVertical_LCDOrientation = 1 - }; - - /** @deprecated set on Device creation. */ - static void SetSubpixelOrientation(LCDOrientation orientation); - /** @deprecated get from Device. */ - static LCDOrientation GetSubpixelOrientation(); - - /** LCD color elements can vary in order. For subpixel text we need to know - the order which the LCDs uses so that the color fringes are in the - correct place. - - Note, if you change this after startup, you'll need to flush the glyph - cache because it'll have the wrong type of masks cached. - - kNONE_LCDOrder means that the subpixel elements are not spatially - separated in any usable fashion. - - @deprecated use SkPixelGeometry instead. - */ - enum LCDOrder { - kRGB_LCDOrder = 0, //!< this is the default - kBGR_LCDOrder = 1, - kNONE_LCDOrder = 2 - }; - - /** @deprecated set on Device creation. */ - static void SetSubpixelOrder(LCDOrder order); - /** @deprecated get from Device. */ - static LCDOrder GetSubpixelOrder(); -}; - -#endif diff --git a/src/core/SkFontHost.cpp b/src/core/SkFontLCDConfig.cpp similarity index 50% rename from src/core/SkFontHost.cpp rename to src/core/SkFontLCDConfig.cpp index 4f0dc8637d..3d1f35b58c 100644 --- a/src/core/SkFontHost.cpp +++ b/src/core/SkFontLCDConfig.cpp @@ -25,24 +25,3 @@ SkFontLCDConfig::LCDOrder SkFontLCDConfig::GetSubpixelOrder() { void SkFontLCDConfig::SetSubpixelOrder(LCDOrder order) { gLCDOrder = order; } - -/////////////////////////////////////////////////////////////////////////////// -// Legacy wrappers : remove from SkFontHost when webkit switches to new API - -#include "SkFontHost.h" - -SkFontHost::LCDOrientation SkFontHost::GetSubpixelOrientation() { - return (SkFontHost::LCDOrientation)SkFontLCDConfig::GetSubpixelOrientation(); -} - -void SkFontHost::SetSubpixelOrientation(LCDOrientation orientation) { - SkFontLCDConfig::SetSubpixelOrientation((SkFontLCDConfig::LCDOrientation)orientation); -} - -SkFontHost::LCDOrder SkFontHost::GetSubpixelOrder() { - return (SkFontHost::LCDOrder)SkFontLCDConfig::GetSubpixelOrder(); -} - -void SkFontHost::SetSubpixelOrder(LCDOrder order) { - SkFontLCDConfig::SetSubpixelOrder((SkFontLCDConfig::LCDOrder)order); -}