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

Unified Diff: core/fxge/include/fx_font.h

Issue 2263623002: Refactor fx_font part 3 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 4 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
Index: core/fxge/include/fx_font.h
diff --git a/core/fxge/include/fx_font.h b/core/fxge/include/fx_font.h
index e6ffc6be4b5ca2cb389898a75afd257f8d415e98..3050d8d571b116fcd2d891ae93b65d42073a9b57 100644
--- a/core/fxge/include/fx_font.h
+++ b/core/fxge/include/fx_font.h
@@ -74,6 +74,17 @@ using CFX_TypeFace = SkTypeface;
#define GET_TT_LONG(w) \
(uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
+// Sets the given transform on the font, and resets it to the identity when it
+// goes out of scope.
+class ScopedFontTransform {
+ public:
+ ScopedFontTransform(FT_Face face, FXFT_Matrix* matrix);
+ ~ScopedFontTransform();
+
+ private:
+ FT_Face m_Face;
+};
+
class CFX_Font {
public:
CFX_Font();
@@ -132,6 +143,13 @@ class CFX_Font {
uint32_t GetSize() const { return m_dwSize; }
void AdjustMMParams(int glyph_index, int width, int weight);
+ static const size_t ANGLESKEW_ARRAY_SIZE = 30;
Lei Zhang 2016/08/19 18:24:46 kConstFoo
npm 2016/08/19 22:02:33 Done.
+ static const char g_AngleSkew[ANGLESKEW_ARRAY_SIZE];
Lei Zhang 2016/08/19 18:24:46 no longer global -> s_ prefix?
npm 2016/08/19 22:02:33 Done.
+ static const size_t WEIGHTPOW_ARRAY_SIZE = 100;
+ static const uint8_t g_WeightPow[WEIGHTPOW_ARRAY_SIZE];
+ static const uint8_t g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE];
+ static const uint8_t g_WeightPow_SHIFTJIS[WEIGHTPOW_ARRAY_SIZE];
+
#ifdef PDF_ENABLE_XFA
protected:
CFX_BinaryBuf m_OtfFontData;
@@ -243,56 +261,6 @@ class CFX_GlyphBitmap {
CFX_DIBitmap m_Bitmap;
};
-class CFX_FaceCache {
- public:
- explicit CFX_FaceCache(FXFT_Face face);
- ~CFX_FaceCache();
- const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont,
- uint32_t glyph_index,
- FX_BOOL bFontStyle,
- const CFX_Matrix* pMatrix,
- int dest_width,
- int anti_alias,
- int& text_flags);
- const CFX_PathData* LoadGlyphPath(CFX_Font* pFont,
- uint32_t glyph_index,
- int dest_width);
-
-#ifdef _SKIA_SUPPORT_
- CFX_TypeFace* GetDeviceCache(CFX_Font* pFont);
-#endif
-
- private:
- CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont,
- uint32_t glyph_index,
- FX_BOOL bFontStyle,
- const CFX_Matrix* pMatrix,
- int dest_width,
- int anti_alias);
- CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont,
- uint32_t glyph_index,
- const CFX_Matrix* pMatrix,
- int dest_width,
- int anti_alias);
- CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont,
- const CFX_Matrix* pMatrix,
- const CFX_ByteString& FaceGlyphsKey,
- uint32_t glyph_index,
- FX_BOOL bFontStyle,
- int dest_width,
- int anti_alias);
- void InitPlatform();
- void DestroyPlatform();
-
- FXFT_Face const m_Face;
- std::map<CFX_ByteString, CFX_SizeGlyphCache*> m_SizeMap;
- std::map<uint32_t, CFX_PathData*> m_PathMap;
- CFX_DIBitmap* m_pBitmap;
-#ifdef _SKIA_SUPPORT_
- CFX_TypeFace* m_pTypeface;
-#endif
-};
-
struct FXTEXT_GLYPHPOS {
const CFX_GlyphBitmap* m_pGlyph;
int m_OriginX;

Powered by Google App Engine
This is Rietveld 408576698