summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-10 12:35:07 -0800
committerWei Li <weili@chromium.org>2016-03-10 12:35:07 -0800
commit79fcb5f6fa61967517566100415972848edefd24 (patch)
tree314016e327303cd3e4e3da06dd1789b79ecbf352 /core/src/fpdfapi/fpdf_render
parent2852ce07c4e5b1053420cbf375e098e09faf679c (diff)
downloadpdfium-79fcb5f6fa61967517566100415972848edefd24.tar.xz
Change colorspace's number of components to be unsigned
Also remove unnecessary casts. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1783933002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 0f9b88e638..3be74c5ce8 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -917,8 +917,8 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
if (pCS) {
FX_FLOAT R, G, B;
FX_DWORD comps = 8;
- if (pCS->CountComponents() > static_cast<int32_t>(comps)) {
- comps = (FX_DWORD)pCS->CountComponents();
+ if (pCS->CountComponents() > comps) {
+ comps = pCS->CountComponents();
}
CFX_FixedBufGrow<FX_FLOAT, 8> float_array(comps);
FX_FLOAT* pFloats = float_array;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 709733c56f..72472ef8fb 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -709,7 +709,7 @@ void CPDF_DIBSource::LoadJpxBitmap() {
FX_BOOL bSwapRGB = FALSE;
if (m_pColorSpace) {
- if (components != (FX_DWORD)m_pColorSpace->CountComponents())
+ if (components != m_pColorSpace->CountComponents())
return;
if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB)) {
@@ -776,7 +776,7 @@ CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor) {
if (pSoftMask) {
CPDF_Array* pMatte = pSoftMask->GetDict()->GetArrayBy("Matte");
if (pMatte && m_pColorSpace &&
- (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
+ m_pColorSpace->CountComponents() <= m_nComponents) {
std::vector<FX_FLOAT> colors(m_nComponents);
for (FX_DWORD i = 0; i < m_nComponents; i++) {
colors[i] = pMatte->GetFloatAt(i);
@@ -801,7 +801,7 @@ int CPDF_DIBSource::StratLoadMask() {
if (m_pMaskStream) {
CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArrayBy("Matte");
if (pMatte && m_pColorSpace &&
- (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
+ m_pColorSpace->CountComponents() <= m_nComponents) {
FX_FLOAT R, G, B;
std::vector<FX_FLOAT> colors(m_nComponents);
for (FX_DWORD i = 0; i < m_nComponents; i++) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index e4876a0d26..92e0ff4d12 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -832,7 +832,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
CPDF_Array* pBackColor =
pPattern->m_pShadingObj->GetDict()->GetArrayBy("Background");
if (pBackColor &&
- pBackColor->GetCount() >= (FX_DWORD)pColorSpace->CountComponents()) {
+ pBackColor->GetCount() >= pColorSpace->CountComponents()) {
CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents());
for (int i = 0; i < pColorSpace->CountComponents(); i++) {
comps[i] = pBackColor->GetNumberAt(i);