summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-05-24 12:20:17 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-05-24 12:20:17 -0700
commit5dc4f24637d353d4d777c251f6d8c5746e062e7e (patch)
tree3b456ac537c2ff58afa268bd4a543a482dbdc1f1 /core/src/fpdfapi/fpdf_render
parent4201b2a5f38a6335d012aa4dc4cd19f6989d05f1 (diff)
downloadpdfium-5dc4f24637d353d4d777c251f6d8c5746e062e7e.tar.xz
Fix warnings in android build, fix font rendering issue, fix issue 357588: wrong characters representation, and addjust some code indent
BUG= R=jam@chromium.org Review URL: https://codereview.chromium.org/294353002
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp48
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h3
3 files changed, 22 insertions, 31 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index 19624329fb..611804bc06 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -508,7 +508,7 @@ FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_Affi
}
CPDF_RenderStatus status;
status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, m_pStopObj,
- this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, TRUE);
+ this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, FALSE);
status.m_curBlend = m_curBlend;
m_pDevice->SaveState();
status.RenderObjectList(pFormObj->m_pForm, &matrix);
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index e67b46c931..91a3725ad7 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -911,37 +911,33 @@ void CPDF_DIBSource::LoadPalette()
}
}
}
-
FX_DWORD CPDF_DIBSource::GetValidBpp() const
{
FX_DWORD bpc = m_bpc;
CPDF_Object * pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
- if(pFilter)
- {
- if(pFilter->GetType() == PDFOBJ_NAME)
- {
+ if (pFilter) {
+ if (pFilter->GetType() == PDFOBJ_NAME) {
CFX_ByteString filter = pFilter->GetString();
- if(filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG2Decode") )
+ if (filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG2Decode")) {
bpc = 1;
- if(filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCTDecode") )
+ }
+ if (filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCTDecode")) {
bpc = 8;
+ }
+ } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array *pArray = (CPDF_Array *)pFilter;
+ if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("CCITTFacDecode") ||
+ pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JBIG2Decode")) {
+ bpc = 1;
+ }
+ if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("RunLengthDecode") ||
+ pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("DCTDecode")) {
+ bpc = 8;
+ }
}
- else if (pFilter->GetType() == PDFOBJ_ARRAY)
- {
- CPDF_Array *pArray = (CPDF_Array *) pFilter;
- if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("CCITTFacDecode") ||
- pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("JBIG2Decode") )
- bpc = 1;
-
- if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("RunLengthDecode") ||
- pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("DCTDecode") )
- bpc = 8;
- }
- }
-
+ }
return bpc;
}
-
#define NORMALCOLOR_MAX(color, max) (color) > (max) ? (max) : (color) < 0 ? 0 : (color);
void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const
{
@@ -969,9 +965,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_
} else {
int src_bit_pos = 0;
int dest_byte_pos = 0;
-
FX_DWORD bpc = GetValidBpp();
-
for (int column = 0; column < m_Width; column ++) {
int R = _GetBits8(src_scan, src_bit_pos, bpc);
src_bit_pos += bpc;
@@ -990,9 +984,9 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_
}
return;
} else 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);
+ 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);
return;
}
}
@@ -1027,9 +1021,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_
} else {
int src_bit_pos = 0;
int dest_byte_pos = 0;
-
FX_DWORD bpc = GetValidBpp();
-
for (int column = 0; column < m_Width; column ++) {
for (FX_DWORD color = 0; color < m_nComponents; color ++) {
int data = _GetBits8(src_scan, src_bit_pos, bpc);
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index 9bde4be877..e8e8ea4651 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -419,8 +419,7 @@ protected:
void LoadPalette();
FX_BOOL CreateDecoder();
void TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const;
- FX_DWORD GetValidBpp() const;
-
+ FX_DWORD GetValidBpp() const;
CPDF_Document* m_pDocument;
const CPDF_Stream* m_pStream;
CPDF_StreamAcc* m_pStreamAcc;