summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
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/fpdfapi/render
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/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp16
-rw-r--r--core/fpdfapi/render/cpdf_type3cache.cpp3
-rw-r--r--core/fpdfapi/render/cpdf_type3glyphs.h4
3 files changed, 13 insertions, 10 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index d5204fe500..367519ac83 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -696,7 +696,6 @@ int BiInterpolImpl(int c0,
struct Coon_Color {
Coon_Color() { memset(comp, 0, sizeof(int) * 3); }
- int comp[3];
// Returns true if successful, false if overflow detected.
bool BiInterpol(Coon_Color colors[4],
@@ -717,16 +716,12 @@ struct Coon_Color {
return std::max({abs(comp[0] - o.comp[0]), abs(comp[1] - o.comp[1]),
abs(comp[2] - o.comp[2])});
}
+
+ int comp[3];
};
#define COONCOLOR_THRESHOLD 4
struct CPDF_PatchDrawer {
- Coon_Color patch_colors[4];
- int max_delta;
- CFX_PathData path;
- CFX_RenderDevice* pDevice;
- int fill_mode;
- int alpha;
void Draw(int x_scale,
int y_scale,
int left,
@@ -825,6 +820,13 @@ struct CPDF_PatchDrawer {
}
}
}
+
+ int max_delta;
+ CFX_PathData path;
+ CFX_RenderDevice* pDevice;
+ int fill_mode;
+ int alpha;
+ Coon_Color patch_colors[4];
};
void DrawCoonPatchMeshes(
diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp
index fe9dfbf9e0..33a440f1ca 100644
--- a/core/fpdfapi/render/cpdf_type3cache.cpp
+++ b/core/fpdfapi/render/cpdf_type3cache.cpp
@@ -21,8 +21,9 @@ namespace {
struct CPDF_UniqueKeyGen {
void Generate(int count, ...);
- char m_Key[128];
+
int m_KeyLen;
+ char m_Key[128];
};
void CPDF_UniqueKeyGen::Generate(int count, ...) {
diff --git a/core/fpdfapi/render/cpdf_type3glyphs.h b/core/fpdfapi/render/cpdf_type3glyphs.h
index 778b639642..7756be309f 100644
--- a/core/fpdfapi/render/cpdf_type3glyphs.h
+++ b/core/fpdfapi/render/cpdf_type3glyphs.h
@@ -24,10 +24,10 @@ class CPDF_Type3Glyphs {
void AdjustBlue(float top, float bottom, int& top_line, int& bottom_line);
std::map<uint32_t, std::unique_ptr<CFX_GlyphBitmap>> m_GlyphMap;
- int m_TopBlue[TYPE3_MAX_BLUES];
- int m_BottomBlue[TYPE3_MAX_BLUES];
int m_TopBlueCount;
int m_BottomBlueCount;
+ int m_TopBlue[TYPE3_MAX_BLUES];
+ int m_BottomBlue[TYPE3_MAX_BLUES];
};
#endif // CORE_FPDFAPI_RENDER_CPDF_TYPE3GLYPHS_H_