diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-12 11:21:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-12 11:21:23 -0700 |
commit | d55e11eeb8ebf1e226a1166f395ba77248ce84c3 (patch) | |
tree | c28b1c1d6ac1597e569618cdeb02e3e0009bf8ed /core/fxge | |
parent | ea98238666e33cd16b69cb23dcaca047c21c9998 (diff) | |
download | pdfium-d55e11eeb8ebf1e226a1166f395ba77248ce84c3.tar.xz |
Remove ICodec_* Interfaces.
All of the ICodec_* interfaces had a single implementation. This CL removes
the interfaces and uses the concrete classes in their place.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1876023003
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/agg/fx_agg_driver.cpp | 4 | ||||
-rw-r--r-- | core/fxge/dib/fx_dib_composite.cpp | 42 | ||||
-rw-r--r-- | core/fxge/dib/fx_dib_convert.cpp | 22 | ||||
-rw-r--r-- | core/fxge/dib/fx_dib_main.cpp | 2 | ||||
-rw-r--r-- | core/fxge/ge/fx_ge_ps.cpp | 2 | ||||
-rw-r--r-- | core/fxge/ge/fx_ge_text.cpp | 2 |
6 files changed, 36 insertions, 38 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 811e65c4e9..364185534e 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -1106,7 +1106,7 @@ class CFX_Renderer { FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag); FX_BOOL bDeviceCMYK = pDevice->IsCmykImage(); m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); - ICodec_IccModule* pIccModule = NULL; + CCodec_IccModule* pIccModule = NULL; if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { pIccTransform = NULL; @@ -1529,7 +1529,7 @@ FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag); int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); color = bObjCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&color, diff --git a/core/fxge/dib/fx_dib_composite.cpp b/core/fxge/dib/fx_dib_composite.cpp index a9a3039ef7..18d73d1f25 100644 --- a/core/fxge/dib/fx_dib_composite.cpp +++ b/core/fxge/dib/fx_dib_composite.cpp @@ -287,7 +287,7 @@ void _CompositeRow_Argb2Graya(uint8_t* dest_scan, const uint8_t* src_alpha_scan, uint8_t* dst_alpha_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = nullptr; + CCodec_IccModule* pIccModule = nullptr; if (pIccTransform) pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); @@ -490,7 +490,7 @@ inline void _CompositeRow_Argb2Gray(uint8_t* dest_scan, const uint8_t* clip_scan, const uint8_t* src_alpha_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = NULL; + CCodec_IccModule* pIccModule = nullptr; uint8_t gray; if (pIccTransform) pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); @@ -586,7 +586,7 @@ inline void _CompositeRow_Rgb2Gray(uint8_t* dest_scan, int blend_type, const uint8_t* clip_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = NULL; + CCodec_IccModule* pIccModule = nullptr; uint8_t gray; if (pIccTransform) { pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); @@ -636,7 +636,7 @@ void _CompositeRow_Rgb2Graya(uint8_t* dest_scan, const uint8_t* clip_scan, uint8_t* dest_alpha_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = NULL; + CCodec_IccModule* pIccModule = nullptr; if (pIccTransform) { pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } @@ -1442,7 +1442,7 @@ void _CompositeRow_Argb2Argb_Transform(uint8_t* dest_scan, uint8_t* src_cache_scan, void* pIccTransform) { uint8_t* dp = src_cache_scan; - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_alpha_scan) { if (dest_alpha_scan) { @@ -1536,7 +1536,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(uint8_t* dest_scan, uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1562,7 +1562,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_Transform( uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1587,7 +1587,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform( uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1611,7 +1611,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform( uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1637,7 +1637,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform( const uint8_t* src_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_alpha_scan) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1688,7 +1688,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend_Transform( const uint8_t* src_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_alpha_scan) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1737,7 +1737,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform( int src_Bpp, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1762,7 +1762,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(uint8_t* dest_scan, const uint8_t* clip_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1786,7 +1786,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform( int src_Bpp, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -1811,7 +1811,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform( const uint8_t* clip_scan, uint8_t* src_cache_scan, void* pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (src_Bpp == 3) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, @@ -3965,9 +3965,8 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int& mask_green, int& mask_blue, int& mask_black, - void* icc_module, + CCodec_IccModule* pIccModule, void* pIccTransform) { - ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module; if (alpha_flag >> 8) { mask_alpha = alpha_flag & 0xff; mask_red = FXSYS_GetCValue(mask_color); @@ -4028,9 +4027,8 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format, uint32_t*& pDestPalette, uint32_t* pSrcPalette, - void* icc_module, + CCodec_IccModule* pIccModule, void* pIccTransform) { - ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module; FX_BOOL isSrcCmyk = !!(src_format & 0x0400); FX_BOOL isDstCmyk = !!(dest_format & 0x0400); pDestPalette = NULL; @@ -4186,7 +4184,7 @@ FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, m_DestFormat = dest_format; m_BlendType = blend_type; m_bRgbByteOrder = bRgbByteOrder; - ICodec_IccModule* pIccModule = NULL; + CCodec_IccModule* pIccModule = nullptr; if (CFX_GEModule::Get()->GetCodecModule()) { pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } @@ -4803,7 +4801,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, if (!IsAlphaMask()) { if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, &gray, color_p, 1); } else { @@ -4877,7 +4875,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, return FALSE; } if (pIccTransform && CFX_GEModule::Get()->GetCodecModule()) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1); } else { diff --git a/core/fxge/dib/fx_dib_convert.cpp b/core/fxge/dib/fx_dib_convert.cpp index 7484620b8f..da380ee567 100644 --- a/core/fxge/dib/fx_dib_convert.cpp +++ b/core/fxge/dib/fx_dib_convert.cpp @@ -192,7 +192,7 @@ FX_BOOL ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, bgr_ptr[4] = FXARGB_G(src_plt[1]); bgr_ptr[5] = FXARGB_R(src_plt[1]); } - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, 2); } else { @@ -254,7 +254,7 @@ FX_BOOL ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, *bgr_ptr++ = FXARGB_R(src_plt[i]); } } - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, 256); @@ -293,7 +293,7 @@ FX_BOOL ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, void* pIccTransform) { int Bpp = pSrcBitmap->GetBPP() / 8; if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); if (Bpp == 3 || pSrcBitmap->IsCmykImage()) { for (int row = 0; row < height; row++) { @@ -401,7 +401,7 @@ FX_BOOL ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, } bgr_ptr = (uint8_t*)plt; } - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, (const uint8_t*)plt, plt_size); @@ -499,7 +499,7 @@ FX_BOOL ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt); if (ret && pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); for (int i = 0; i < 256; i++) { FX_ARGB* plt = dst_plt + i; @@ -589,7 +589,7 @@ FX_BOOL ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, bgr_ptr[5] = FXARGB_R(src_plt[1]); } if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, (const uint8_t*)plt, 2); @@ -650,7 +650,7 @@ FX_BOOL ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, plt[i] = FXCMYK_TODIB(src_plt[i]); } } - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, (const uint8_t*)plt, 256); @@ -688,7 +688,7 @@ FX_BOOL ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int src_top, void* pIccTransform) { if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; @@ -726,7 +726,7 @@ FX_BOOL ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, } } if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; @@ -745,7 +745,7 @@ FX_BOOL ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, void* pIccTransform) { int comps = pSrcBitmap->GetBPP() / 8; if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; @@ -782,7 +782,7 @@ FX_BOOL ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int src_top, void* pIccTransform) { if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp index 4503fd506f..f781392e67 100644 --- a/core/fxge/dib/fx_dib_main.cpp +++ b/core/fxge/dib/fx_dib_main.cpp @@ -490,7 +490,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, uint8_t* color_p = (uint8_t*)&dst_color; if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1); } else { diff --git a/core/fxge/ge/fx_ge_ps.cpp b/core/fxge/ge/fx_ge_ps.cpp index 241a184ed1..98253336a1 100644 --- a/core/fxge/ge/fx_ge_ps.cpp +++ b/core/fxge/ge/fx_ge_ps.cpp @@ -506,7 +506,7 @@ void CFX_PSRenderer::SetColor(uint32_t color, } FX_BOOL bCMYK = FALSE; if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp index e074fa4f26..f65e34a3e8 100644 --- a/core/fxge/ge/fx_ge_text.cpp +++ b/core/fxge/ge/fx_ge_text.cpp @@ -158,7 +158,7 @@ void _Color2Argb(FX_ARGB& argb, } uint8_t bgra[4]; if (pIccTransform) { - ICodec_IccModule* pIccModule = + CCodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); |