summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-03 16:32:19 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-03 16:32:19 +0000
commit232b918d1f0faec230652f4097b834257a7dbb27 (patch)
treec13213ab3d70cc147a6ea59b0f090a51beecae8f /core/fxge
parent36d7ad4a24287b562e1d88fcde635e36a167bfe3 (diff)
downloadpdfium-232b918d1f0faec230652f4097b834257a7dbb27.tar.xz
Re-arrange so inline vectors come last in structs.
This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/cfx_facecache.cpp2
-rw-r--r--core/fxge/cfx_fontmapper.h4
-rw-r--r--core/fxge/cfx_renderdevice.h2
-rw-r--r--core/fxge/cttfontdesc.cpp2
-rw-r--r--core/fxge/cttfontdesc.h5
-rw-r--r--core/fxge/win32/cfx_psrenderer.cpp2
6 files changed, 8 insertions, 9 deletions
diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp
index ea72905f1b..ba316c1451 100644
--- a/core/fxge/cfx_facecache.cpp
+++ b/core/fxge/cfx_facecache.cpp
@@ -40,8 +40,8 @@ constexpr int kMaxGlyphDimension = 2048;
struct UniqueKeyGen {
void Generate(int count, ...);
- char key_[128];
int key_len_;
+ char key_[128];
};
void UniqueKeyGen::Generate(int count, ...) {
diff --git a/core/fxge/cfx_fontmapper.h b/core/fxge/cfx_fontmapper.h
index 13d906c2df..215eec97c2 100644
--- a/core/fxge/cfx_fontmapper.h
+++ b/core/fxge/cfx_fontmapper.h
@@ -74,12 +74,12 @@ class CFX_FontMapper {
};
bool m_bListLoaded;
- FXFT_Face m_MMFaces[MM_FACE_COUNT];
ByteString m_LastFamily;
std::vector<FaceData> m_FaceArray;
std::unique_ptr<SystemFontInfoIface> m_pFontInfo;
- FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
UnownedPtr<CFX_FontMgr> const m_pFontMgr;
+ FXFT_Face m_MMFaces[MM_FACE_COUNT];
+ FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
};
#endif // CORE_FXGE_CFX_FONTMAPPER_H_
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 757dfdf17f..eed72eb036 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -73,7 +73,6 @@ class FXTEXT_CHARPOS {
FXTEXT_CHARPOS(const FXTEXT_CHARPOS&);
~FXTEXT_CHARPOS();
- float m_AdjustMatrix[4];
CFX_PointF m_Origin;
uint32_t m_Unicode;
uint32_t m_GlyphIndex;
@@ -84,6 +83,7 @@ class FXTEXT_CHARPOS {
int32_t m_FallbackFontPosition;
bool m_bGlyphAdjust;
bool m_bFontStyle;
+ float m_AdjustMatrix[4];
};
class CFX_RenderDevice {
diff --git a/core/fxge/cttfontdesc.cpp b/core/fxge/cttfontdesc.cpp
index bdf24518b7..97a12732e7 100644
--- a/core/fxge/cttfontdesc.cpp
+++ b/core/fxge/cttfontdesc.cpp
@@ -10,7 +10,7 @@
#include "third_party/base/stl_util.h"
CTTFontDesc::CTTFontDesc(uint8_t* pData, FXFT_Face face)
- : m_bIsTTC(false), m_SingleFace(face), m_pFontData(pData) {}
+ : m_bIsTTC(false), m_pFontData(pData), m_SingleFace(face) {}
CTTFontDesc::CTTFontDesc(uint8_t* pData, size_t index, FXFT_Face face)
: m_bIsTTC(true), m_pFontData(pData) {
diff --git a/core/fxge/cttfontdesc.h b/core/fxge/cttfontdesc.h
index b48e78c6b6..bc0ea1737f 100644
--- a/core/fxge/cttfontdesc.h
+++ b/core/fxge/cttfontdesc.h
@@ -40,13 +40,12 @@ class CTTFontDesc {
private:
const bool m_bIsTTC;
-
+ int m_RefCount = 1;
+ uint8_t* const m_pFontData;
union {
const FXFT_Face m_SingleFace;
FXFT_Face m_TTCFaces[16];
};
- uint8_t* const m_pFontData;
- int m_RefCount = 1;
};
#endif // CORE_FXGE_CTTFONTDESC_H_
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 6c4b8ec6f3..036cb43577 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -89,8 +89,8 @@ struct PSGlyph {
class CPSFont {
public:
- PSGlyph m_Glyphs[256];
int m_nGlyphs;
+ PSGlyph m_Glyphs[256];
};
CFX_PSRenderer::CFX_PSRenderer()