summaryrefslogtreecommitdiff
path: root/core/src/fxge/dib
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-08-19 13:25:44 -0700
committerTom Sepez <tsepez@chromium.org>2015-08-19 13:25:44 -0700
commitc3f4894a6862c74b9ab32b4ec38c531de6ecd83c (patch)
treef5ad333e8d418d5a978a595f51e94b3ad8f365da /core/src/fxge/dib
parent71c15a5e6652952a94ba3a3ef7ac0392e3a06962 (diff)
downloadpdfium-c3f4894a6862c74b9ab32b4ec38c531de6ecd83c.tar.xz
Extern in .cpp file is a code smell, part 2.
Fixes the remaining issues, except for JBIG2/Skia ... R=thestig@chromium.org Review URL: https://codereview.chromium.org/1298393003 .
Diffstat (limited to 'core/src/fxge/dib')
-rw-r--r--core/src/fxge/dib/dib_int.h8
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp5
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp9
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp17
4 files changed, 22 insertions, 17 deletions
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h
index d40e3a4f95..69f28234eb 100644
--- a/core/src/fxge/dib/dib_int.h
+++ b/core/src/fxge/dib/dib_int.h
@@ -7,6 +7,8 @@
#ifndef CORE_SRC_FXGE_DIB_DIB_INT_H_
#define CORE_SRC_FXGE_DIB_DIB_INT_H_
+extern const int SDP_Table[513];
+
class CPDF_FixedMatrix {
public:
CPDF_FixedMatrix(const CFX_AffineMatrix& src, int bits) {
@@ -89,4 +91,10 @@ class CStretchEngine {
int m_State;
};
+FX_RECT FXDIB_SwapClipBox(FX_RECT& clip,
+ int width,
+ int height,
+ FX_BOOL bFlipX,
+ FX_BOOL bFlipY);
+
#endif // CORE_SRC_FXGE_DIB_DIB_INT_H_
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index 7443926df4..56bb5abafa 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -4,11 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <limits.h>
+
#include "../../../include/fxge/fx_dib.h"
#include "../../../include/fxge/fx_ge.h"
#include "dib_int.h"
-#include <limits.h>
-extern int SDP_Table[513];
+
void CWeightTable::Calc(int dest_len,
int dest_min,
int dest_max,
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index b98fc6b359..8c7e831e8c 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -1551,11 +1551,6 @@ CFX_ImageRenderer::CFX_ImageRenderer() {
CFX_ImageRenderer::~CFX_ImageRenderer() {
delete m_pTransformer;
}
-extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip,
- int width,
- int height,
- FX_BOOL bFlipX,
- FX_BOOL bFlipY);
FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice,
const CFX_ClipRgn* pClipRgn,
const CFX_DIBSource* pSource,
@@ -1596,8 +1591,8 @@ FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice,
int dest_height = image_rect.Height();
FX_RECT bitmap_clip = m_ClipBox;
bitmap_clip.Offset(-image_rect.left, -image_rect.top);
- bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height,
- m_Matrix.c > 0, m_Matrix.b < 0);
+ bitmap_clip = FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height,
+ m_Matrix.c > 0, m_Matrix.b < 0);
m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox,
TRUE, m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder,
alpha_flag, pIccTransform, m_BlendType);
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 887964ba00..d368a95c35 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -6,7 +6,8 @@
#include "../../../include/fxge/fx_dib.h"
#include "dib_int.h"
-int SDP_Table[513] = {
+
+const int SDP_Table[513] = {
256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255,
254, 254, 254, 254, 253, 253, 253, 252, 252, 252, 251, 251, 251, 250, 250,
249, 249, 249, 248, 248, 247, 247, 246, 246, 245, 244, 244, 243, 243, 242,
@@ -165,11 +166,11 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip,
return pTransBitmap;
}
#define FIX16_005 0.05f
-FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip,
- int width,
- int height,
- FX_BOOL bFlipX,
- FX_BOOL bFlipY) {
+FX_RECT FXDIB_SwapClipBox(FX_RECT& clip,
+ int width,
+ int height,
+ FX_BOOL bFlipX,
+ FX_BOOL bFlipY) {
FX_RECT rect;
if (bFlipY) {
rect.left = height - clip.top;
@@ -253,8 +254,8 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc,
int dest_width = result_rect.Width();
int dest_height = result_rect.Height();
result_clip.Offset(-result_rect.left, -result_rect.top);
- result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height,
- pDestMatrix->c > 0, pDestMatrix->b < 0);
+ result_clip = FXDIB_SwapClipBox(result_clip, dest_width, dest_height,
+ pDestMatrix->c > 0, pDestMatrix->b < 0);
m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip,
flags);
m_Status = 1;