diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 14:42:09 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 14:42:09 -0700 |
commit | 2f2ffece124e4ed4b96d2846263015d4b5ad6c00 (patch) | |
tree | 6966e44279e8d9e1516b7c71219cf66f77a89ca2 /core/src/fpdfapi/fpdf_render | |
parent | d07958fd2d1c4134d865f4ccb056eb925aaa7d2a (diff) | |
download | pdfium-2f2ffece124e4ed4b96d2846263015d4b5ad6c00.tar.xz |
Merge to XFA - else after returns.
(cherry picked from commit 3c012fef2bb72c8ec1faa73e11ee35539b2559d6)
Original Review URL: https://codereview.chromium.org/1243953004 .
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1239313005 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp | 10 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 18 |
3 files changed, 22 insertions, 12 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index a894e846ee..19c01a102c 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -551,7 +551,8 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bTyp CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState; if (m_pType3Char && !bType3 && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_FillColor.IsNull())))) { return m_T3FillColor; - } else if (!pColorData || pColorData->m_FillColor.IsNull()) { + } + if (!pColorData || pColorData->m_FillColor.IsNull()) { pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState; } FX_COLORREF rgb = pColorData->m_FillRGB; @@ -580,7 +581,8 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState; if (m_pType3Char && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_StrokeColor.IsNull())))) { return m_T3FillColor; - } else if (!pColorData || pColorData->m_StrokeColor.IsNull()) { + } + if (!pColorData || pColorData->m_StrokeColor.IsNull()) { pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState; } FX_COLORREF rgb = pColorData->m_StrokeRGB; diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index 0730206e23..fa9325a4d2 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -761,7 +761,8 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, m_pQuickStretcher->m_ResultTop, m_BlendType); return FALSE; - } else if (m_Status == 2) { + } + if (m_Status == 2) { if (m_pTransformer->Continue(pPause)) { return TRUE; } @@ -784,16 +785,17 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) } delete pBitmap; return FALSE; - } else if (m_Status == 3) { + } + if (m_Status == 3) { return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause); - } else if (m_Status == 4) { + } + if (m_Status == 4) { if (m_Loader.Continue(m_LoadHandle, pPause)) { return TRUE; } if (StartRenderDIBSource()) { return Continue(pPause); } - return FALSE; } return FALSE; } diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index ce29baf738..7d17e78e24 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -21,13 +21,17 @@ unsigned int _GetBits8(const uint8_t* pData, int bitpos, int nbits) unsigned int byte = pData[bitpos / 8]; if (nbits == 8) { return byte; - } else if (nbits == 4) { + } + if (nbits == 4) { return (bitpos % 8) ? (byte & 0x0f) : (byte >> 4); - } else if (nbits == 2) { + } + if (nbits == 2) { return (byte >> (6 - bitpos % 8)) & 0x03; - } else if (nbits == 1) { + } + if (nbits == 1) { return (byte >> (7 - bitpos % 8)) & 0x01; - } else if (nbits == 16) { + } + if (nbits == 16) { return byte * 256 + pData[bitpos / 8 + 1]; } return 0; @@ -462,7 +466,8 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) m_pColorSpace->EnableStdConversion(FALSE); } return ret1; - } else if (m_Status == 2) { + } + if (m_Status == 2) { return ContinueLoadMaskDIB(pPause); } return 0; @@ -1008,7 +1013,8 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan, const uint8_t* s break; } return; - } else if (m_bpc == 8) { + } + if (m_bpc == 8) { if (m_nComponents == m_pColorSpace->CountComponents()) m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK); |