From bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Jun 2015 13:24:12 -0700 Subject: Merge to XFA: Use stdint.h types throughout PDFium. Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002 --- core/src/fxge/agg/agg23/fx_agg_driver.cpp | 54 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'core/src/fxge/agg') diff --git a/core/src/fxge/agg/agg23/fx_agg_driver.cpp b/core/src/fxge/agg/agg23/fx_agg_driver.cpp index 5944332fd8..978756cd64 100644 --- a/core/src/fxge/agg/agg23/fx_agg_driver.cpp +++ b/core/src/fxge/agg/agg23/fx_agg_driver.cpp @@ -411,7 +411,7 @@ public: } else { src_alpha = m_Alpha; } - FX_BYTE dest_alpha = ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255; + uint8_t dest_alpha = ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; if (m_bFullCover) { @@ -485,7 +485,7 @@ public: dest_scan += 2; continue; } - FX_BYTE cover = cover_scan[col]; + uint8_t cover = cover_scan[col]; dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], src_alpha, cover); *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover); dest_scan ++; @@ -544,7 +544,7 @@ public: } else { int index = 0; if (m_pDevice->GetPalette() == NULL) { - index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0; + index = ((uint8_t)m_Color == 0xff) ? 1 : 0; } else { for (int i = 0; i < 2; i ++) if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) { @@ -582,7 +582,7 @@ public: dest_scan += col_start / 8; int index = 0; if (m_pDevice->GetPalette() == NULL) { - index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0; + index = ((uint8_t)m_Color == 0xff) ? 1 : 0; } else { for (int i = 0; i < 2; i ++) if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) { @@ -637,7 +637,7 @@ public: *dest_scan = m_Gray; *dest_extra_alpha_scan = m_Alpha; } else { - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; @@ -696,7 +696,7 @@ public: if (src_alpha == 255) { *(FX_DWORD*)dest_scan = m_Color; } else { - FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_ratio); @@ -739,7 +739,7 @@ public: dest_scan += 2; continue; } - FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; + uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio); @@ -812,13 +812,13 @@ public: } if (src_alpha) { if (src_alpha == 255) { - *dest_scan++ = (FX_BYTE)m_Blue; - *dest_scan++ = (FX_BYTE)m_Green; - *dest_scan++ = (FX_BYTE)m_Red; - *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha; + *dest_scan++ = (uint8_t)m_Blue; + *dest_scan++ = (uint8_t)m_Green; + *dest_scan++ = (uint8_t)m_Red; + *dest_extra_alpha_scan++ = (uint8_t)m_Alpha; continue; } else { - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; @@ -902,9 +902,9 @@ public: if (src_alpha) { if (src_alpha == 255) { *(FX_CMYK*)dest_scan = m_Color; - *dest_extra_alpha_scan = (FX_BYTE)m_Alpha; + *dest_extra_alpha_scan = (uint8_t)m_Alpha; } else { - FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha - + uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha - (*dest_extra_alpha_scan) * src_alpha / 255; *dest_extra_alpha_scan++ = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; @@ -1038,13 +1038,13 @@ public: m_Gray = 255; } else { if (pIccTransform) { - FX_BYTE gray; + uint8_t gray; color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); pIccModule->TranslateScanline(pIccTransform, &gray, (FX_LPCBYTE)&color, 1); m_Gray = gray; } else { if (bObjectCMYK) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), r, g, b); m_Gray = FXRGB2GRAY(r, g, b); @@ -1089,7 +1089,7 @@ public: } } else { if (bObjectCMYK) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), r, g, b); m_Color = FXARGB_MAKE(m_Alpha, r, g, b); @@ -1201,7 +1201,7 @@ void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb) if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) { return; } - FX_LPBYTE pos = (FX_BYTE*)pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8; + FX_LPBYTE pos = (uint8_t*)pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8; if (pBitmap->GetFormat() == FXDIB_Argb) { FXARGB_SETRGBORDERDIB(pos, ArgbGamma(argb)); } else { @@ -1224,7 +1224,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid int Bpp = pBitmap->GetBPP() / 8; FX_BOOL bAlpha = pBitmap->HasAlpha(); int dib_argb = FXARGB_TOBGRORDERDIB(argb); - FX_BYTE* pBuffer = pBitmap->GetBuffer(); + uint8_t* pBuffer = pBitmap->GetBuffer(); if (src_alpha == 255) { for (int row = rect.top; row < rect.bottom; row ++) { FX_LPBYTE dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp; @@ -1250,13 +1250,13 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid FX_LPBYTE dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp; if (bAlpha) { for (int col = 0; col < width; col ++) { - FX_BYTE back_alpha = dest_scan[3]; + 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)); dest_scan += 4; continue; } - FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; + uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255; dest_scan[3] = dest_alpha; int alpha_ratio = src_alpha * 255 / dest_alpha; *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio); @@ -1295,7 +1295,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t FXDIB_Format dest_format = pBitmap->GetFormat(); FXDIB_Format src_format = pSrcBitmap->GetFormat(); int pitch = pBitmap->GetPitch(); - FX_BYTE* buffer = pBitmap->GetBuffer(); + uint8_t* buffer = pBitmap->GetBuffer(); if (dest_format == src_format) { for (int row = 0; row < height; row ++) { FX_LPBYTE dest_scan = buffer + (dest_top + row) * pitch + dest_left * Bpp; @@ -1322,7 +1322,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t if (src_format == FXDIB_Rgb32) { for (int row = 0; row < height; row ++) { FX_LPBYTE dest_scan = dest_buf + row * pitch; - FX_LPBYTE src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left * 4; + FX_LPBYTE src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 4; for (int col = 0; col < width; col ++) { *dest_scan++ = src_scan[2]; *dest_scan++ = src_scan[1]; @@ -1336,8 +1336,8 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t } else if (dest_format == FXDIB_Argb || dest_format == FXDIB_Rgb32) { if (src_format == FXDIB_Rgb) { for (int row = 0; row < height; row ++) { - FX_BYTE* dest_scan = (FX_BYTE*)(dest_buf + row * pitch); - FX_LPBYTE src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3; + uint8_t* dest_scan = (uint8_t*)(dest_buf + row * pitch); + FX_LPBYTE src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3; if (src_format == FXDIB_Argb) { for (int col = 0; col < width; col ++) { FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, FX_GAMMA(src_scan[0]), FX_GAMMA(src_scan[1]), FX_GAMMA(src_scan[2]))); @@ -1368,9 +1368,9 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t ASSERT(FALSE); } } -FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, FX_BYTE alpha) +FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha) { - FX_BYTE r, g, b; + uint8_t r, g, b; AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk), r, g, b); return ArgbEncode(alpha, r, g, b); -- cgit v1.2.3