summaryrefslogtreecommitdiff
path: root/core
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
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')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp10
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp18
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp10
-rw-r--r--core/fxge/cfx_renderdevice.cpp2
-rw-r--r--core/fxge/dib/cfx_dibitmap.cpp8
-rw-r--r--core/fxge/dib/cfx_dibsource.cpp2
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp4
-rw-r--r--core/fxge/dib/cfx_scanlinecompositor.cpp36
-rw-r--r--core/fxge/dib/fx_dib_main.cpp4
-rw-r--r--core/fxge/fx_dib.h2
-rw-r--r--core/fxge/skia/fx_skia_device.cpp12
11 files changed, 53 insertions, 55 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) {
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index ab6ee49c7e..a19868f764 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -109,7 +109,7 @@ void RgbByteOrderCompositeRect(const RetainPtr<CFX_DIBitmap>& pBitmap,
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan,
- FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ ArgbEncode(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
@@ -169,8 +169,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
src_left * Bpp;
if (Bpp == 4) {
for (int col = 0; col < width; col++) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_scan[3], src_scan[0],
- src_scan[1], src_scan[2]));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(src_scan[3], src_scan[0],
+ src_scan[1], src_scan[2]));
dest_scan += 4;
src_scan += 4;
}
@@ -213,7 +213,7 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
src_left * 3;
for (int col = 0; col < width; col++) {
FXARGB_SETDIB(dest_scan,
- FXARGB_MAKE(0xff, src_scan[0], src_scan[1], src_scan[2]));
+ ArgbEncode(0xff, src_scan[0], src_scan[1], src_scan[2]));
dest_scan += 4;
src_scan += 3;
}
@@ -230,7 +230,7 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
src_left * 4;
for (int col = 0; col < width; col++) {
FXARGB_SETDIB(dest_scan,
- FXARGB_MAKE(0xff, src_scan[0], src_scan[1], src_scan[2]));
+ ArgbEncode(0xff, src_scan[0], src_scan[1], src_scan[2]));
src_scan += 4;
dest_scan += 4;
}
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 826f14dfa7..aed1bff94e 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -148,7 +148,7 @@ void NormalizeArgb(int src_value,
int src_alpha) {
uint8_t back_alpha = dest[3];
if (back_alpha == 0)
- FXARGB_SETDIB(dest, FXARGB_MAKE(src_alpha, r, g, b));
+ FXARGB_SETDIB(dest, ArgbEncode(src_alpha, r, g, b));
else if (src_alpha != 0)
ApplyDestAlpha(back_alpha, src_alpha, r, g, b, dest);
}
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 15e821cf11..f17ca52095 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -738,8 +738,8 @@ void CFX_DIBitmap::ConvertBGRColorScale(uint32_t forecolor,
FXARGB_G(m_pPalette.get()[i]),
FXARGB_B(m_pPalette.get()[i]));
m_pPalette.get()[i] =
- FXARGB_MAKE(0xff, br + (fr - br) * gray / 255,
- bg + (fg - bg) * gray / 255, bb + (fb - bb) * gray / 255);
+ ArgbEncode(0xff, br + (fr - br) * gray / 255,
+ bg + (fg - bg) * gray / 255, bb + (fb - bb) * gray / 255);
}
return;
}
@@ -1153,8 +1153,8 @@ bool CFX_DIBitmap::CompositeRect(int left,
for (int col = 0; col < width; col++) {
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2],
- color_p[1], color_p[0]));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, color_p[2],
+ color_p[1], color_p[0]));
dest_scan += 4;
continue;
}
diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibsource.cpp
index f140a5e838..757547783d 100644
--- a/core/fxge/dib/cfx_dibsource.cpp
+++ b/core/fxge/dib/cfx_dibsource.cpp
@@ -302,7 +302,7 @@ void ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf,
std::tie(r, g, b) = AdobeCMYK_to_sRGB1(
FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]),
FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]));
- dst_plt[i] = FXARGB_MAKE(0xff, r, g, b);
+ dst_plt[i] = ArgbEncode(0xff, r, g, b);
}
} else {
memcpy(dst_plt, src_plt, plt_size * 4);
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 68867b5560..9cd5cea10e 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -132,7 +132,7 @@ void WriteColorResult(std::function<uint8_t(int offset)> func,
uint32_t* dest32 = reinterpret_cast<uint32_t*>(dest);
if (bHasAlpha) {
if (format == FXDIB_Argb) {
- *dest32 = FXARGB_TODIB(FXARGB_MAKE(func(3), red_y, green_m, blue_c));
+ *dest32 = FXARGB_TODIB(ArgbEncode(func(3), red_y, green_m, blue_c));
} else if (format == FXDIB_Rgba) {
dest[0] = blue_c;
dest[1] = green_m;
@@ -146,7 +146,7 @@ void WriteColorResult(std::function<uint8_t(int offset)> func,
if (format == FXDIB_Cmyka) {
*dest32 = FXCMYK_TODIB(CmykEncode(blue_c, green_m, red_y, func(3)));
} else {
- *dest32 = FXARGB_TODIB(FXARGB_MAKE(kOpaqueAlpha, red_y, green_m, blue_c));
+ *dest32 = FXARGB_TODIB(ArgbEncode(kOpaqueAlpha, red_y, green_m, blue_c));
}
}
diff --git a/core/fxge/dib/cfx_scanlinecompositor.cpp b/core/fxge/dib/cfx_scanlinecompositor.cpp
index ae27ee0246..948dd59838 100644
--- a/core/fxge/dib/cfx_scanlinecompositor.cpp
+++ b/core/fxge/dib/cfx_scanlinecompositor.cpp
@@ -394,8 +394,8 @@ void CompositeRow_Argb2Argb(uint8_t* dest_scan,
if (!has_src)
++src_scan;
} else {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE((src_alpha << 24), src_scan[2],
- src_scan[1], *src_scan));
+ FXARGB_SETDIB(dest_scan, ArgbEncode((src_alpha << 24), src_scan[2],
+ src_scan[1], *src_scan));
}
if (!has_dest) {
dest_scan += dest_offset;
@@ -464,8 +464,8 @@ void CompositeRow_Rgb2Argb_Blend_NoClip(uint8_t* dest_scan,
if (src_Bpp == 4) {
FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
} else {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1],
- src_scan[0]));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(0xff, src_scan[2], src_scan[1],
+ src_scan[0]));
}
dest_scan += 4;
}
@@ -637,7 +637,7 @@ void CompositeRow_Rgb2Argb_NoBlend_NoClip(uint8_t* dest_scan,
FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
} else {
FXARGB_SETDIB(dest_scan,
- FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
+ ArgbEncode(0xff, src_scan[2], src_scan[1], src_scan[0]));
}
dest_scan += 4;
src_scan += src_Bpp;
@@ -1322,10 +1322,10 @@ void CompositeRow_8bppRgb2Argb_NoBlend(uint8_t* dest_scan,
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, src_r, src_g, src_b));
} else {
FXARGB_SETDIB(dest_scan,
- FXARGB_MAKE(*src_alpha_scan, src_r, src_g, src_b));
+ ArgbEncode(*src_alpha_scan, src_r, src_g, src_b));
}
dest_scan += 4;
src_alpha_scan++;
@@ -1511,7 +1511,7 @@ void CompositeRow_ByteMask2Argb(uint8_t* dest_scan,
}
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
@@ -1769,7 +1769,7 @@ void CompositeRow_BitMask2Argb(uint8_t* dest_scan,
int blend_type,
const uint8_t* clip_scan) {
if (blend_type == FXDIB_BLEND_NORMAL && !clip_scan && mask_alpha == 255) {
- FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
+ FX_ARGB argb = ArgbEncode(0xff, src_r, src_g, src_b);
for (int col = 0; col < pixel_count; col++) {
if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
FXARGB_SETDIB(dest_scan, argb);
@@ -1791,7 +1791,7 @@ void CompositeRow_BitMask2Argb(uint8_t* dest_scan,
}
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
@@ -2072,8 +2072,8 @@ void CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan,
if (src_Bpp == 4) {
FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
} else {
- FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2],
- src_scan[1], src_scan[0]));
+ FXARGB_SETRGBORDERDIB(
+ dest_scan, ArgbEncode(0xff, src_scan[2], src_scan[1], src_scan[0]));
}
dest_scan += 4;
src_scan += src_Bpp;
@@ -2151,7 +2151,7 @@ void CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan,
FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
} else {
FXARGB_SETRGBORDERDIB(
- dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
+ dest_scan, ArgbEncode(0xff, src_scan[2], src_scan[1], src_scan[0]));
}
dest_scan += 4;
src_scan += src_Bpp;
@@ -2578,7 +2578,7 @@ void CompositeRow_ByteMask2Argb_RgbByteOrder(uint8_t* dest_scan,
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan,
- FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ ArgbEncode(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
@@ -2682,7 +2682,7 @@ void CompositeRow_BitMask2Argb_RgbByteOrder(uint8_t* dest_scan,
int blend_type,
const uint8_t* clip_scan) {
if (blend_type == FXDIB_BLEND_NORMAL && !clip_scan && mask_alpha == 255) {
- FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
+ FX_ARGB argb = ArgbEncode(0xff, src_r, src_g, src_b);
for (int col = 0; col < pixel_count; col++) {
if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
FXARGB_SETRGBORDERDIB(dest_scan, argb);
@@ -2705,7 +2705,7 @@ void CompositeRow_BitMask2Argb_RgbByteOrder(uint8_t* dest_scan,
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan,
- FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ ArgbEncode(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
@@ -2950,7 +2950,7 @@ void CFX_ScanlineCompositor::InitSourcePalette(FXDIB_Format src_format,
std::tie(r, g, b) =
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk),
FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk));
- pPalette[i] = FXARGB_MAKE(0xff, r, g, b);
+ pPalette[i] = ArgbEncode(0xff, r, g, b);
}
}
return;
@@ -2985,7 +2985,7 @@ void CFX_ScanlineCompositor::InitSourcePalette(FXDIB_Format src_format,
std::tie(r, g, b) =
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk),
FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk));
- pPalette[i] = FXARGB_MAKE(0xff, r, g, b);
+ pPalette[i] = ArgbEncode(0xff, r, g, b);
}
}
}
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index e2e2213e8f..2fd3cc05e5 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -93,8 +93,8 @@ FX_COLORREF ArgbToColorRef(FX_ARGB argb) {
}
FX_ARGB AlphaAndColorRefToArgb(int a, FX_COLORREF colorref) {
- return FXARGB_MAKE(a, FXSYS_GetRValue(colorref), FXSYS_GetGValue(colorref),
- FXSYS_GetBValue(colorref));
+ return ArgbEncode(a, FXSYS_GetRValue(colorref), FXSYS_GetGValue(colorref),
+ FXSYS_GetBValue(colorref));
}
FX_ARGB StringToFXARGB(const WideStringView& wsValue) {
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h
index 57e844b946..3475e5c4bd 100644
--- a/core/fxge/fx_dib.h
+++ b/core/fxge/fx_dib.h
@@ -128,8 +128,6 @@ FX_ARGB StringToFXARGB(const WideStringView& view);
#define FXARGB_R(argb) ((uint8_t)((argb) >> 16))
#define FXARGB_G(argb) ((uint8_t)((argb) >> 8))
#define FXARGB_B(argb) ((uint8_t)(argb))
-#define FXARGB_MAKE(a, r, g, b) \
- (((uint32_t)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define FXARGB_MUL_ALPHA(argb, alpha) \
(((((argb) >> 24) * (alpha) / 255) << 24) | ((argb)&0xffffff))
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index c68fd57798..0329eac104 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -84,8 +84,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
(uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
if (Bpp == 4) {
for (int col = 0; col < width; col++) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_scan[3], src_scan[0],
- src_scan[1], src_scan[2]));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(src_scan[3], src_scan[0],
+ src_scan[1], src_scan[2]));
dest_scan += 4;
src_scan += 4;
}
@@ -128,8 +128,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
uint8_t* src_scan =
(uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
for (int col = 0; col < width; col++) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[0], src_scan[1],
- src_scan[2]));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(0xff, src_scan[0], src_scan[1],
+ src_scan[2]));
dest_scan += 4;
src_scan += 3;
}
@@ -141,8 +141,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
uint8_t* src_scan =
(uint8_t*)(pSrcBitmap->GetScanline(src_top + row) + src_left * 4);
for (int col = 0; col < width; col++) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[0], src_scan[1],
- src_scan[2]));
+ FXARGB_SETDIB(dest_scan, ArgbEncode(0xff, src_scan[0], src_scan[1],
+ src_scan[2]));
src_scan += 4;
dest_scan += 4;
}