summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-26 08:45:31 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-26 08:45:31 -0700
commit16b703cb504abedbae3e14f69c1ae355363a7ad8 (patch)
treee3561dae57648b23312c06991d96795ef0524b6c /core/fpdfapi/render
parent04c1009af887eb5d3a183dd26421f644f63d8b77 (diff)
downloadpdfium-16b703cb504abedbae3e14f69c1ae355363a7ad8.tar.xz
Fix some bool/int mismatches.
Found by winxfa bot when fx_bool defined to bool. Review-Url: https://codereview.chromium.org/2449293002
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/fpdf_render_loadimage.cpp2
-rw-r--r--core/fpdfapi/render/fpdf_render_pattern.cpp20
2 files changed, 13 insertions, 9 deletions
diff --git a/core/fpdfapi/render/fpdf_render_loadimage.cpp b/core/fpdfapi/render/fpdf_render_loadimage.cpp
index a4f0e7befb..553481db60 100644
--- a/core/fpdfapi/render/fpdf_render_loadimage.cpp
+++ b/core/fpdfapi/render/fpdf_render_loadimage.cpp
@@ -551,7 +551,7 @@ int CPDF_DIBSource::CreateDecoder() {
} else if (decoder == "DCTDecode") {
m_pDecoder.reset(CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
src_data, src_size, m_Width, m_Height, m_nComponents,
- pParams ? pParams->GetIntegerFor("ColorTransform", 1) : 1));
+ !pParams || pParams->GetIntegerFor("ColorTransform", 1)));
if (!m_pDecoder) {
bool bTransform = false;
int comps;
diff --git a/core/fpdfapi/render/fpdf_render_pattern.cpp b/core/fpdfapi/render/fpdf_render_pattern.cpp
index dfb5669d8f..f55a0e8b97 100644
--- a/core/fpdfapi/render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/render/fpdf_render_pattern.cpp
@@ -54,17 +54,19 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT start_y = pCoords->GetNumberAt(1);
FX_FLOAT end_x = pCoords->GetNumberAt(2);
FX_FLOAT end_y = pCoords->GetNumberAt(3);
- FX_FLOAT t_min = 0, t_max = 1.0f;
+ FX_FLOAT t_min = 0;
+ FX_FLOAT t_max = 1.0f;
CPDF_Array* pArray = pDict->GetArrayFor("Domain");
if (pArray) {
t_min = pArray->GetNumberAt(0);
t_max = pArray->GetNumberAt(1);
}
- FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
+ FX_BOOL bStartExtend = FALSE;
+ FX_BOOL bEndExtend = FALSE;
pArray = pDict->GetArrayFor("Extend");
if (pArray) {
- bStartExtend = pArray->GetIntegerAt(0);
- bEndExtend = pArray->GetIntegerAt(1);
+ bStartExtend = !!pArray->GetIntegerAt(0);
+ bEndExtend = !!pArray->GetIntegerAt(1);
}
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
@@ -139,17 +141,19 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT end_r = pCoords->GetNumberAt(5);
CFX_Matrix matrix;
matrix.SetReverse(*pObject2Bitmap);
- FX_FLOAT t_min = 0, t_max = 1.0f;
+ FX_FLOAT t_min = 0;
+ FX_FLOAT t_max = 1.0f;
CPDF_Array* pArray = pDict->GetArrayFor("Domain");
if (pArray) {
t_min = pArray->GetNumberAt(0);
t_max = pArray->GetNumberAt(1);
}
- FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
+ FX_BOOL bStartExtend = FALSE;
+ FX_BOOL bEndExtend = FALSE;
pArray = pDict->GetArrayFor("Extend");
if (pArray) {
- bStartExtend = pArray->GetIntegerAt(0);
- bEndExtend = pArray->GetIntegerAt(1);
+ bStartExtend = !!pArray->GetIntegerAt(0);
+ bEndExtend = !!pArray->GetIntegerAt(1);
}
uint32_t total_results =
std::max(CountOutputs(funcs), pCS->CountComponents());