summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-16 16:22:37 -0700
committerLei Zhang <thestig@chromium.org>2015-10-16 16:22:37 -0700
commitc40ccaff017691b7d31e0597863bfb954aebd739 (patch)
tree4f5f09c672393e130037826256ab182e2d2ae7f5 /core/src/fpdfapi/fpdf_render
parenta725bc9a3525256976c112b2b5a429a119cf9b69 (diff)
downloadpdfium-c40ccaff017691b7d31e0597863bfb954aebd739.tar.xz
Merge to XFA: Fix a bunch of sign mismatch warnings.
Also remove some gotos and move code into an anonymous namespace. And then do the partial revert to avoid size_t going negative. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 . Review URL: https://codereview.chromium.org/1400723002 . (cherry picked from commit d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd) (cherry picked from commit a398ca611d1925182ff6a4e8b2b43c277c364dc0) Review URL: https://codereview.chromium.org/1406373002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp16
2 files changed, 11 insertions, 9 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 1e7f077d48..c3029e0091 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -738,7 +738,7 @@ void CPDF_DIBSource::LoadJpxBitmap() {
}
m_pCachedBitmap->Clear(0xFFFFFFFF);
std::vector<uint8_t> output_offsets(components);
- for (int i = 0; i < components; ++i)
+ for (FX_DWORD i = 0; i < components; ++i)
output_offsets[i] = i;
if (bSwapRGB) {
output_offsets[0] = 2;
@@ -1484,7 +1484,7 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp,
bTransMask);
}
} else {
- for (int j = 0; j < m_nComponents; ++j) {
+ for (FX_DWORD j = 0; j < m_nComponents; ++j) {
int color_value =
(int)((m_pCompData[j].m_DecodeMin +
m_pCompData[j].m_DecodeStep * (FX_FLOAT)pSrcPixel[j]) *
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index eff7b06e67..472e96a3c4 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -525,7 +525,7 @@ class CPDF_CharPosList {
FXTEXT_CHARPOS* m_pCharPos;
FX_DWORD m_nChars;
};
-FX_FLOAT _CIDTransformToFloat(uint8_t ch);
+
CPDF_CharPosList::CPDF_CharPosList() {
m_pCharPos = NULL;
}
@@ -578,12 +578,14 @@ void CPDF_CharPosList::Load(int nChars,
}
const uint8_t* pTransform = pCIDFont->GetCIDTransform(CID);
if (pTransform && !bVert) {
- charpos.m_AdjustMatrix[0] = _CIDTransformToFloat(pTransform[0]);
- charpos.m_AdjustMatrix[2] = _CIDTransformToFloat(pTransform[2]);
- charpos.m_AdjustMatrix[1] = _CIDTransformToFloat(pTransform[1]);
- charpos.m_AdjustMatrix[3] = _CIDTransformToFloat(pTransform[3]);
- charpos.m_OriginX += _CIDTransformToFloat(pTransform[4]) * FontSize;
- charpos.m_OriginY += _CIDTransformToFloat(pTransform[5]) * FontSize;
+ charpos.m_AdjustMatrix[0] = pCIDFont->CIDTransformToFloat(pTransform[0]);
+ charpos.m_AdjustMatrix[2] = pCIDFont->CIDTransformToFloat(pTransform[2]);
+ charpos.m_AdjustMatrix[1] = pCIDFont->CIDTransformToFloat(pTransform[1]);
+ charpos.m_AdjustMatrix[3] = pCIDFont->CIDTransformToFloat(pTransform[3]);
+ charpos.m_OriginX +=
+ pCIDFont->CIDTransformToFloat(pTransform[4]) * FontSize;
+ charpos.m_OriginY +=
+ pCIDFont->CIDTransformToFloat(pTransform[5]) * FontSize;
charpos.m_bGlyphAdjust = TRUE;
}
}