Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp |
| diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp |
| index 215b1041620791d1db95e26d66eeb77e4a592970..d83207b1bf4614eaf1be2ca468c4aaf72758b5b4 100644 |
| --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp |
| +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp |
| @@ -74,25 +74,26 @@ 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; |
| - } |
| + } |
| + if (width % 8 && (pBuf[width / 8] & (0xff << (8 - width % 8)))) |
|
Tom Sepez
2016/03/01 17:38:05
nit: or just
return (width % 8 && (pBuf[width /
dsinclair
2016/03/01 18:11:51
Done.
|
| + return TRUE; |
| return FALSE; |
| } |
| + |
| 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(); |