diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-03-01 14:45:20 -0500 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-03-01 14:45:20 -0500 |
commit | 738b08ce6b9f80d93b815411b47c2b11c2f090f6 (patch) | |
tree | ec648b9bdf6d9597043bfe657d56f98dc3cdef30 /core/src/fpdfapi/fpdf_render | |
parent | 50dfc4a7068e8e08105f7b9a3945136e7246e677 (diff) | |
download | pdfium-738b08ce6b9f80d93b815411b47c2b11c2f090f6.tar.xz |
Fix and enable lint checks.
This CL fixes and enables:
* readability/namespace
* readability/multiline_string
* readability/multiline_comment
* readability/inheritance
* readability/function
* readability/braces
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1747123002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp | 10 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp | 21 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/render_int.h | 2 |
3 files changed, 17 insertions, 16 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index 954d3886b5..b91f258371 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -247,12 +247,11 @@ void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, *dest_buf++ = m_RampR[*(src_buf++)]; if (!bSkip) { *dest_buf++ = *src_buf; - } #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - else { + } else { dest_buf++; - } #endif + } src_buf++; } break; @@ -284,7 +283,7 @@ void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, dest_buf++; src_buf++; } - } else + } else { #endif for (int i = 0; i < pixels; i++) { *dest_buf++ = m_RampB[*(src_buf++)]; @@ -292,6 +291,9 @@ void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, *dest_buf++ = m_RampR[*(src_buf++)]; *dest_buf++ = *(src_buf++); } +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + } +#endif } } CPDF_ImageRenderer::CPDF_ImageRenderer() { diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp index 215b104162..42c378666e 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -74,25 +74,24 @@ void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top, top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue); bottom_line = _AdjustBlue(bottom, m_BottomBlueCount, m_BottomBlue); } + static FX_BOOL _IsScanLine1bpp(uint8_t* pBuf, int width) { int size = width / 8; - for (int i = 0; i < size; i++) - if (pBuf[i]) { - return TRUE; - } - if (width % 8) - if (pBuf[width / 8] & (0xff << (8 - width % 8))) { + for (int i = 0; i < size; i++) { + if (pBuf[i]) return TRUE; - } - return FALSE; + } + return (width % 8) && (pBuf[width / 8] & (0xff << (8 - width % 8))); } + static FX_BOOL _IsScanLine8bpp(uint8_t* pBuf, int width) { - for (int i = 0; i < width; i++) - if (pBuf[i] > 0x40) { + for (int i = 0; i < width; i++) { + if (pBuf[i] > 0x40) return TRUE; - } + } return FALSE; } + static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_BOOL bFirst) { int height = pBitmap->GetHeight(), pitch = pBitmap->GetPitch(), width = pBitmap->GetWidth(); diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h index b7f007dd5d..d691f7dc52 100644 --- a/core/src/fpdfapi/fpdf_render/render_int.h +++ b/core/src/fpdfapi/fpdf_render/render_int.h @@ -498,7 +498,7 @@ class CPDF_DIBSource : public CFX_DIBSource { void SetDownSampleSize(int dest_width, int dest_height) override; CFX_DIBitmap* GetBitmap() const; - void ReleaseBitmap(CFX_DIBitmap*) const; + void ReleaseBitmap(CFX_DIBitmap* pBitmap) const; void ClearImageData(); FX_DWORD GetMatteColor() const { return m_MatteColor; } |