summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-29 18:45:39 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-29 18:45:39 +0000
commit162a31a6af1538acf7ac9835111626161287d742 (patch)
tree7235629237d6ff187e68a116604acd83c6700b1a /core/fpdfapi/render
parentac8357b3ec7e1fe4000ebcae5ce65a38bfeb5cb1 (diff)
downloadpdfium-162a31a6af1538acf7ac9835111626161287d742.tar.xz
Get rid of FXARGB_MAKE macro.
ArgbEncode() does the same thing. Change-Id: Ibb05ed4aae720c0a5ba66771699c0d7e11230921 Reviewed-on: https://pdfium-review.googlesource.com/32230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp10
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp18
2 files changed, 14 insertions, 14 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp
index 4241fb1b40..3a4ca02cc2 100644
--- a/core/fpdfapi/render/cpdf_dibsource.cpp
+++ b/core/fpdfapi/render/cpdf_dibsource.cpp
@@ -669,8 +669,8 @@ CPDF_DIBSource::LoadState CPDF_DIBSource::StartLoadMask() {
float G;
float B;
m_pColorSpace->GetRGB(colors.data(), &R, &G, &B);
- m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255),
- FXSYS_round(B * 255));
+ m_MatteColor = ArgbEncode(0, FXSYS_round(R * 255), FXSYS_round(G * 255),
+ FXSYS_round(B * 255));
}
return StartLoadMaskDIB();
}
@@ -1257,7 +1257,7 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp,
// last_src_x used to store the last seen src_x position which should be
// in [0, src_width). Set the initial value to be an invalid src_x value.
uint32_t last_src_x = src_width;
- FX_ARGB last_argb = FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF);
+ FX_ARGB last_argb = ArgbEncode(0xFF, 0xFF, 0xFF, 0xFF);
float unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1);
for (int i = 0; i < clip_width; i++) {
int dest_x = clip_left + i;
@@ -1311,9 +1311,9 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp,
const uint8_t* pSrc =
m_bDefaultDecode ? pSrcPixel : extracted_components;
m_pColorSpace->TranslateImageLine(color, pSrc, 1, 0, 0, bTransMask);
- argb = FXARGB_MAKE(0xFF, color[2], color[1], color[0]);
+ argb = ArgbEncode(0xFF, color[2], color[1], color[0]);
} else {
- argb = FXARGB_MAKE(0xFF, pSrcPixel[2], pSrcPixel[1], pSrcPixel[0]);
+ argb = ArgbEncode(0xFF, pSrcPixel[2], pSrcPixel[1], pSrcPixel[0]);
}
if (m_bColorKey) {
int alpha = 0xFF;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index f99000bb69..d63d321b9f 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -171,8 +171,8 @@ void DrawAxialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
float B = 0.0f;
pCS->GetRGB(pResults, &R, &G, &B);
rgb_array[i] =
- FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255),
- FXSYS_round(G * 255), FXSYS_round(B * 255)));
+ FXARGB_TODIB(ArgbEncode(alpha, FXSYS_round(R * 255),
+ FXSYS_round(G * 255), FXSYS_round(B * 255)));
}
int pitch = pBitmap->GetPitch();
CFX_Matrix matrix = pObject2Bitmap->GetInverse();
@@ -257,8 +257,8 @@ void DrawRadialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
float B = 0.0f;
pCS->GetRGB(pResults, &R, &G, &B);
rgb_array[i] =
- FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255),
- FXSYS_round(G * 255), FXSYS_round(B * 255)));
+ FXARGB_TODIB(ArgbEncode(alpha, FXSYS_round(R * 255),
+ FXSYS_round(G * 255), FXSYS_round(B * 255)));
}
float a = ((start_x - end_x) * (start_x - end_x)) +
((start_y - end_y) * (start_y - end_y)) -
@@ -392,7 +392,7 @@ void DrawFuncShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
float G = 0.0f;
float B = 0.0f;
pCS->GetRGB(pResults, &R, &G, &B);
- dib_buf[column] = FXARGB_TODIB(FXARGB_MAKE(
+ dib_buf[column] = FXARGB_TODIB(ArgbEncode(
alpha, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255)));
}
}
@@ -489,8 +489,8 @@ void DrawGouraud(const RetainPtr<CFX_DIBitmap>& pBitmap,
G += g_unit;
B += b_unit;
FXARGB_SETDIB(dib_buf,
- FXARGB_MAKE(alpha, (int32_t)(R * 255), (int32_t)(G * 255),
- (int32_t)(B * 255)));
+ ArgbEncode(alpha, (int32_t)(R * 255), (int32_t)(G * 255),
+ (int32_t)(B * 255)));
dib_buf += 4;
}
}
@@ -799,8 +799,8 @@ struct CPDF_PatchDrawer {
}
pDevice->DrawPath(
&path, nullptr, nullptr,
- FXARGB_MAKE(alpha, div_colors[0].comp[0], div_colors[0].comp[1],
- div_colors[0].comp[2]),
+ ArgbEncode(alpha, div_colors[0].comp[0], div_colors[0].comp[1],
+ div_colors[0].comp[2]),
0, fillFlags);
} else {
if (d_bottom < COONCOLOR_THRESHOLD && d_top < COONCOLOR_THRESHOLD) {