Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 2019603002: Remove unused PS generation code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@print_clean
Patch Set: Remove more dead code - reland 2d63eaa Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 75f6a231a4966c04a9a999a0e174979a7392807f..b9b5be2c153c1bc15943e27759bf74a8da635d72 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -561,19 +561,20 @@ int CPDF_DIBSource::CreateDecoder() {
src_data, src_size, m_Width, m_Height, m_nComponents,
pParams ? pParams->GetIntegerBy("ColorTransform", 1) : 1));
if (!m_pDecoder) {
- FX_BOOL bTransform = FALSE;
+ bool bTransform = false;
int comps;
int bpc;
CCodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
- if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps,
- bpc, bTransform)) {
+ if (pJpegModule->LoadInfo(src_data, src_size, &m_Width, &m_Height, &comps,
+ &bpc, &bTransform)) {
if (m_nComponents != static_cast<uint32_t>(comps)) {
FX_Free(m_pCompData);
m_pCompData = nullptr;
m_nComponents = static_cast<uint32_t>(comps);
if (m_pColorSpace &&
- m_pColorSpace->CountComponents() != m_nComponents)
+ m_pColorSpace->CountComponents() != m_nComponents) {
return 0;
+ }
if (m_Family == PDFCS_LAB && m_nComponents != 3)
return 0;
m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey);
@@ -613,17 +614,14 @@ int CPDF_DIBSource::CreateDecoder() {
FX_SAFE_UINT32 requested_pitch =
CalculatePitch8(m_bpc, m_nComponents, m_Width);
- if (!requested_pitch.IsValid()) {
+ if (!requested_pitch.IsValid())
return 0;
- }
FX_SAFE_UINT32 provided_pitch = CalculatePitch8(
m_pDecoder->GetBPC(), m_pDecoder->CountComps(), m_pDecoder->GetWidth());
- if (!provided_pitch.IsValid()) {
+ if (!provided_pitch.IsValid())
return 0;
- }
- if (provided_pitch.ValueOrDie() < requested_pitch.ValueOrDie()) {
+ if (provided_pitch.ValueOrDie() < requested_pitch.ValueOrDie())
return 0;
- }
return 1;
}

Powered by Google App Engine
This is Rietveld 408576698