diff options
author | Nico Weber <thakis@chromium.org> | 2014-07-29 08:55:54 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2014-07-29 08:55:54 -0700 |
commit | c77e8f73397613f278eaeef2cae44debc6a684c8 (patch) | |
tree | 325d52616e193459f3cb248ce910852333d5d59d /core/src/fxge | |
parent | 3b07e751353a12d1b4605abfa96881c8eae1bbe5 (diff) | |
download | pdfium-c77e8f73397613f278eaeef2cae44debc6a684c8.tar.xz |
Remove a few unused variables, functions, and tables.
Found by clang's -Wunused-variable, -Wunused-function, -Wunused-const-variable.
BUG=none
R=bo_xu@foxitsoftware.com
Review URL: https://codereview.chromium.org/404653005
Diffstat (limited to 'core/src/fxge')
-rw-r--r-- | core/src/fxge/apple/fx_quartz_device.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_composite.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_engine.cpp | 16 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_main.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_transform.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_font.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 4 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_path.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_text.cpp | 64 |
9 files changed, 8 insertions, 82 deletions
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp index 7cb94f1093..050d8744bd 100644 --- a/core/src/fxge/apple/fx_quartz_device.cpp +++ b/core/src/fxge/apple/fx_quartz_device.cpp @@ -853,7 +853,6 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars a / 255.f); SaveState(); if (pGlyphMatrix) { - CGAffineTransform ctm = CGContextGetCTM(_context); CGPoint origin = CGPointMake( glyph_positions[0].x, glyph_positions[0].y); origin = CGPointApplyAffineTransform(origin, matrix_cg); CGContextTranslateCTM(_context, origin.x, origin.y); diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp index da555de9d5..375b7c110e 100644 --- a/core/src/fxge/dib/fx_dib_composite.cpp +++ b/core/src/fxge/dib/fx_dib_composite.cpp @@ -2951,7 +2951,6 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP } inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp) { - int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { if (src_Bpp == 4) { FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index 803d906ff9..b436f88bd6 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -421,7 +421,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 5: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]]; @@ -449,7 +449,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 6: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; pixel_weight = pixel_weight * src_scan_mask[j] / 255; @@ -466,7 +466,6 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_a += pixel_weight; } if (m_Flags & FXDIB_BICUBIC_INTERPOL) { - dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k; dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c; dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m; dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y; @@ -482,7 +481,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 7: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + j * Bpp; @@ -505,7 +504,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 8: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + j * Bpp; @@ -601,7 +600,7 @@ void CStretchEngine::StretchVert() case 7: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp; - int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch; @@ -629,7 +628,7 @@ void CStretchEngine::StretchVert() if (m_DestFormat != FXDIB_Argb) { src_scan_mask = m_pExtraAlphaBuf + (col - m_DestClip.left); } - int dest_a = 0, dest_k = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; + int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch; @@ -835,7 +834,7 @@ FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) return FALSE; } int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height(); - int src_width = m_pSource->GetWidth(), src_height = m_pSource->GetHeight(); + int src_height = m_pSource->GetHeight(); for (; m_LineIndex < result_height; m_LineIndex ++) { int dest_y, src_y; if (m_bFlipY) { @@ -855,7 +854,6 @@ FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) return TRUE; } m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); - FX_LPBYTE scan_extra_alpha = NULL; if (m_pMaskScanline) { m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); } diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index 3e1e8cf91b..7e8cb0c3db 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -447,7 +447,6 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h if (width == 0 || height == 0) { return TRUE; } - int src_pitch = pMask->GetPitch(); int src_bpp = pMask->GetBPP(); int alpha; FX_DWORD dst_color; diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index 16d791b4ee..65afdd6b3a 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -538,7 +538,6 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) int Bpp = m_Storer.GetBitmap()->GetBPP() / 8; int destBpp = pTransformed->GetBPP() / 8; if (Bpp == 1) { - FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha(); FX_DWORD argb[256]; FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette(); if (pPal) { diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index f3254ea3de..817f3712d9 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -40,7 +40,6 @@ CFX_Font::~CFX_Font() #endif if (m_Face) { #ifdef FOXIT_CHROME_BUILD - FXFT_Library library = FXFT_Get_Face_FreeType(m_Face); if (FXFT_Get_Face_External_Stream(m_Face)) { FXFT_Clear_Face_External_Stream(m_Face); } diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 1b47f1ff14..f5d378d55b 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -975,8 +975,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru FX_BOOL bItalic = FALSE; FX_DWORD nStyle = 0; FX_BOOL bStyleAvail = FALSE; - FX_BOOL bFamilyStyleIsWhole = FALSE; - FX_BOOL bNextF = FALSE; if (iBaseFont < 12) { family = g_Base14FontNames[iBaseFont]; if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) { @@ -1535,7 +1533,7 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE } if (datasize && size >= datasize && pFile) { FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET); - size_t readCnt = FXSYS_fread(buffer, datasize, 1, pFile); + FXSYS_fread(buffer, datasize, 1, pFile); } if (pFile) { FXSYS_fclose(pFile); diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp index cd3ff0efbe..b96a2f1163 100644 --- a/core/src/fxge/ge/fx_ge_path.cpp +++ b/core/src/fxge/ge/fx_ge_path.cpp @@ -405,7 +405,6 @@ void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix) pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY); } } -const int g_Distant[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const { if (m_PointCount < 3) { diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index 40acc5fe34..80af2ff197 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -78,28 +78,6 @@ static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars) next_origin_f = this_origin_f; } } -static const FX_BYTE g_GdipGamma_bgw[9] = {0, 0, 63, 120, 0, 168, 210, 239, 255}; -static const FX_BYTE g_GdipGamma_fgw[9] = {0, 0, 16, 45, 0, 87, 135, 192, 255}; -static const FX_BYTE g_GdipGammaAdjust_47[48] = { - 0, 30, 33, 34, 35, 36, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, - 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 46, - 46, 46, 46, 46, 46, 46, 46, 47 -}; -static const FX_BYTE g_GdipGammaAdjust_75[76] = { - 0, 46, 50, 52, 54, 55, 56, 57, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, - 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, - 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, - 73, 74, 74, 74, 74, 74, 74, 74, 74, 75 -}; -static const FX_BYTE g_GdipGammaAdjust_81[82] = { - 0, 49, 53, 56, 58, 59, 60, 61, 62, 63, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, - 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 73, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 76, 76, 76, 76, - 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, - 80, 80, 80, 80, 80, 80, 80, 81 -}; -static void _Adjust_alpha(int background, int foreground, int& src_alpha, int text_flags, int a) -{ -} static const FX_BYTE g_TextGammaAdjust[256] = { 0, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38, @@ -1213,48 +1191,6 @@ CFX_SizeGlyphCache::~CFX_SizeGlyphCache() #else #define CONTRAST_RAMP_STEP 1 #endif -static const FX_BYTE g_adjust_contrast11[256] = { - 0, 0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 31, - 32, 33, 35, 36, 38, 39, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 56, 58, 59, 61, 62, 64, 65, - 67, 68, 70, 71, 72, 74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 91, 93, 94, 96, 97, 99, 100, - 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 120, 121, 123, 124, 125, 127, - 128, 130, 131, 132, 134, 135, 136, 138, 139, 140, 142, 143, 144, 146, 147, 148, 149, 151, 152, - 153, 155, 156, 157, 158, 160, 161, 162, 163, 165, 166, 167, 168, 169, 171, 172, 173, 174, 175, - 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 215, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 224, 225, 226, 227, 227, 228, 229, 230, - 230, 231, 232, 232, 233, 234, 234, 235, 236, 236, 237, 237, 238, 239, 239, 240, 240, 241, 241, - 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248, 248, 248, 249, 249, 249, - 250, 250, 250, 251, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 254, 254, - 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, -}; -static const FX_BYTE g_adjust_contrast15[256] = { - 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51, - 52, 54, 55, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 84, 85, 87, - 88, 90, 91, 93, 94, 95, 97, 98, 100, 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 119, - 120, 122, 123, 125, 126, 128, 129, 130, 132, 133, 135, 136, 138, 139, 141, 142, 143, 145, 146, 148, - 149, 150, 152, 153, 155, 156, 157, 159, 160, 161, 163, 164, 166, 167, 168, 170, 171, 172, 174, 175, - 176, 177, 179, 180, 181, 183, 184, 185, 186, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 235, 236, 237, - 237, 238, 239, 239, 240, 241, 241, 242, 242, 243, 244, 244, 245, 245, 246, 246, 247, 247, 248, 248, - 248, 249, 249, 250, 250, 250, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 254, 254, - 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, -}; -static void _CalcContrastRamp(FX_LPBYTE ramp, int level) -{ - int contrast_min = 0, contrast_max = 255 - level, i; - for (i = 0; i < contrast_min; i ++) { - ramp[i] = 0; - } - for (i = contrast_min; i < contrast_max; i ++) { - ramp[i] = 255 * (i - contrast_min) / (contrast_max - contrast_min); - } - for (i = contrast_max; i < 256; i ++) { - ramp[i] = 255; - } -} void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight) { FXFT_MM_Var pMasters = NULL; |