summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-07-29 10:13:17 -0700
committerNico Weber <thakis@chromium.org>2014-07-29 10:13:17 -0700
commit6c55495fcaf634e7f788f4dfe77fa1a106c9cd55 (patch)
tree3fe8612d47f51ff551e480a2088a48349cd9bdf7 /core/src/fpdfapi/fpdf_render
parentc77e8f73397613f278eaeef2cae44debc6a684c8 (diff)
downloadpdfium-6c55495fcaf634e7f788f4dfe77fa1a106c9cd55.tar.xz
Fix a few more warnings in chromium_code mode.
No intended behavior change. - Remove more unused variables, functions, member variables. - Put a few constructor initializers in the order they execute in. - Add braces for subobject initializers. - Fix a handful of signed / unsigned comparisons. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/429593005
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp5
3 files changed, 6 insertions, 14 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index eb08bca8a7..45b6970e2a 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -171,16 +171,16 @@ void CPDF_PageRenderCache::ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap*
m_nCacheSize = pImageCache->EstimateSize() - oldsize;
}
CPDF_ImageCache::CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream)
- : m_pDocument(pDoc)
- , m_pStream(pStream)
- , m_pCachedBitmap(NULL)
- , m_pCachedMask(NULL)
- , m_dwCacheSize(0)
- , m_dwTimeCount(0)
+ : m_dwTimeCount(0)
, m_pCurBitmap(NULL)
, m_pCurMask(NULL)
, m_MatteColor(0)
, m_pRenderStatus(NULL)
+ , m_pDocument(pDoc)
+ , m_pStream(pStream)
+ , m_pCachedBitmap(NULL)
+ , m_pCachedMask(NULL)
+ , m_dwCacheSize(0)
{
}
CPDF_ImageCache::~CPDF_ImageCache()
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 81cff01f50..7f442eb15c 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -945,7 +945,6 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_
if (m_bDefaultDecode) {
if (m_Family == PDFCS_DEVICERGB || m_Family == PDFCS_CALRGB) {
if (m_bpc == 16) {
- FX_LPBYTE dest_pos = dest_scan;
FX_LPCBYTE src_pos = src_scan;
for (int col = 0; col < m_Width; col ++) {
*dest_scan++ = src_pos[4];
@@ -954,7 +953,6 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_
src_pos += 6;
}
} else if (m_bpc == 8) {
- FX_LPBYTE dest_pos = dest_scan;
FX_LPCBYTE src_pos = src_scan;
for (int column = 0; column < m_Width; column ++) {
*dest_scan++ = src_pos[2];
@@ -1360,7 +1358,6 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_
if (src_x % 2) {
src_bit_pos = 4;
}
- int value = (1 << bpc) - 1;
for (FX_DWORD i = 0; i < m_nComponents; i ++) {
temp[i] = (FX_BYTE)(_GetBits8(pSrcPixel, src_bit_pos, bpc) * unit_To8Bpc);
src_bit_pos += bpc;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index ba0ca84ec4..7ffd186f72 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -71,7 +71,6 @@ static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2B
rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
}
int pitch = pBitmap->GetPitch();
- int Bpp = pBitmap->GetBPP() / 8;
for (int row = 0; row < height; row ++) {
FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
for (int column = 0; column < width; column ++) {
@@ -156,7 +155,6 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
int pitch = pBitmap->GetPitch();
- int Bpp = pBitmap->GetBPP() / 8;
FX_BOOL bDecreasing = FALSE;
if (start_r > end_r) {
int length = (int)FXSYS_sqrt((FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y)));
@@ -245,7 +243,6 @@ static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bi
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
int pitch = pBitmap->GetPitch();
- int Bpp = pBitmap->GetBPP() / 8;
int total_results = 0;
for (int j = 0; j < nFuncs; j ++) {
if (pFuncs[j]) {
@@ -743,8 +740,6 @@ static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_Aff
void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix,
FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode)
{
- int width = clip_rect.Width();
- int height = clip_rect.Height();
CPDF_Function** pFuncs = pPattern->m_pFunctions;
int nFuncs = pPattern->m_nFuncs;
CPDF_Dictionary* pDict = pPattern->m_pShadingObj->GetDict();