Index: src/core/SkFontMgr.cpp |
diff --git a/src/core/SkFontHost.cpp b/src/core/SkFontMgr.cpp |
similarity index 66% |
copy from src/core/SkFontHost.cpp |
copy to src/core/SkFontMgr.cpp |
index 8092a590c24a1e21ef2852caccb91a2665ec90e3..ca29e293efb1c5e606aef198dae217bda5a0616a 100644 |
--- a/src/core/SkFontHost.cpp |
+++ b/src/core/SkFontMgr.cpp |
@@ -1,82 +1,17 @@ |
/* |
- * Copyright 2009 The Android Open Source Project |
+ * Copyright 2015 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
-#include "SkFontLCDConfig.h" |
+#include "SkFontMgr.h" |
#include "SkLazyPtr.h" |
+#include "SkTypes.h" |
-static SkFontLCDConfig::LCDOrientation gLCDOrientation = SkFontLCDConfig::kHorizontal_LCDOrientation; |
-static SkFontLCDConfig::LCDOrder gLCDOrder = SkFontLCDConfig::kRGB_LCDOrder; |
- |
-SkFontLCDConfig::LCDOrientation SkFontLCDConfig::GetSubpixelOrientation() { |
- return gLCDOrientation; |
-} |
- |
-void SkFontLCDConfig::SetSubpixelOrientation(LCDOrientation orientation) { |
- gLCDOrientation = orientation; |
-} |
- |
-SkFontLCDConfig::LCDOrder SkFontLCDConfig::GetSubpixelOrder() { |
- return gLCDOrder; |
-} |
- |
-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); |
-} |
- |
-/////////////////////////////////////////////////////////////////////////////// |
-/////////////////////////////////////////////////////////////////////////////// |
- |
-#include "SkFontStyle.h" |
- |
-SkFontStyle::SkFontStyle() { |
- fUnion.fU32 = 0; |
- fUnion.fR.fWeight = kNormal_Weight; |
- fUnion.fR.fWidth = kNormal_Width; |
- fUnion.fR.fSlant = kUpright_Slant; |
-} |
- |
-SkFontStyle::SkFontStyle(int weight, int width, Slant slant) { |
- fUnion.fU32 = 0; |
- fUnion.fR.fWeight = SkPin32(weight, kThin_Weight, kBlack_Weight); |
- fUnion.fR.fWidth = SkPin32(width, kUltraCondensed_Width, kUltaExpanded_Width); |
- fUnion.fR.fSlant = SkPin32(slant, kUpright_Slant, kItalic_Slant); |
-} |
- |
-SkFontStyle::SkFontStyle(unsigned oldStyle) { |
- fUnion.fU32 = 0; |
- fUnion.fR.fWeight = (oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight |
- : SkFontStyle::kNormal_Weight; |
- fUnion.fR.fWidth = SkFontStyle::kNormal_Width; |
- fUnion.fR.fSlant = (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant |
- : SkFontStyle::kUpright_Slant; |
-} |
- |
-#include "SkFontMgr.h" |
+class SkFontStyle; |
+class SkStream; |
+class SkTypeface; |
class SkEmptyFontStyleSet : public SkFontStyleSet { |
public: |