diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:17:45 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:17:45 -0700 |
commit | 6581175666ba4e1eb2826142376cbfe4495c6e76 (patch) | |
tree | 38770d7cf709979b0d493a6ca0367a0cbc080736 /core/src/fxge/dib | |
parent | 05f11bcf48a630b53cac603538bb75f21ad4231d (diff) | |
download | pdfium-6581175666ba4e1eb2826142376cbfe4495c6e76.tar.xz |
Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.
Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
follwed by scripts.
Original Review URL: https://codereview.chromium.org/1179693003.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1179953002.
Diffstat (limited to 'core/src/fxge/dib')
-rw-r--r-- | core/src/fxge/dib/fx_dib_composite.cpp | 16 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_convert.cpp | 18 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_engine.cpp | 2 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_main.cpp | 48 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_transform.cpp | 2 |
5 files changed, 43 insertions, 43 deletions
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp index aeee91bb4b..b2a72253d8 100644 --- a/core/src/fxge/dib/fx_dib_composite.cpp +++ b/core/src/fxge/dib/fx_dib_composite.cpp @@ -297,7 +297,7 @@ void _CompositeRow_Rgb2Mask(uint8_t* dest_scan, const uint8_t* src_scan, int wid clip_scan ++; } } else { - FXSYS_memset8(dest_scan, 0xff, width); + FXSYS_memset(dest_scan, 0xff, width); } } void _CompositeRow_Argb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan, @@ -1331,7 +1331,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip(uint8_t* dest_scan, const uint8_t* inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp) { if (dest_Bpp == src_Bpp) { - FXSYS_memcpy32(dest_scan, src_scan, width * dest_Bpp); + FXSYS_memcpy(dest_scan, src_scan, width * dest_Bpp); return; } for (int col = 0; col < width; col ++) { @@ -3662,7 +3662,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB int palsize = 1 << (src_format & 0xff); pDestPalette = FX_Alloc(FX_DWORD, palsize); if (isDstCmyk == isSrcCmyk) { - FXSYS_memcpy32(pDestPalette, pSrcPalette, palsize * sizeof(FX_DWORD)); + FXSYS_memcpy(pDestPalette, pSrcPalette, palsize * sizeof(FX_DWORD)); } else { for (int i = 0; i < palsize; i ++) { FX_CMYK cmyk = pSrcPalette[i]; @@ -4236,7 +4236,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX for (int row = rect.top; row < rect.bottom; row ++) { uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left; if (src_alpha == 255) { - FXSYS_memset8(dest_scan, gray, width); + FXSYS_memset(dest_scan, gray, width); } else for (int col = 0; col < width; col ++) { *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha); @@ -4264,7 +4264,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX uint8_t left_flag = *dest_scan_top & (255 << (8 - left_shift)); uint8_t right_flag = *dest_scan_top_r & (255 >> right_shift); if (width) { - FXSYS_memset8(dest_scan_top + 1, index ? 255 : 0, width - 1); + FXSYS_memset(dest_scan_top + 1, index ? 255 : 0, width - 1); if (!index) { *dest_scan_top &= left_flag; *dest_scan_top_r &= right_flag; @@ -4308,7 +4308,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp; uint8_t* dest_scan_alpha = m_pAlphaMask ? (uint8_t*)m_pAlphaMask->GetScanline(row) + rect.left : NULL; if (dest_scan_alpha) { - FXSYS_memset8(dest_scan_alpha, 0xff, width); + FXSYS_memset(dest_scan_alpha, 0xff, width); } if (Bpp == 4) { FX_DWORD* scan = (FX_DWORD*)dest_scan; @@ -4352,7 +4352,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX uint8_t back_alpha = *dest_scan_alpha; if (back_alpha == 0) { *dest_scan_alpha++ = src_alpha; - FXSYS_memcpy32(dest_scan, color_p, Bpp); + FXSYS_memcpy(dest_scan, color_p, Bpp); dest_scan += Bpp; continue; } @@ -4457,7 +4457,7 @@ void CFX_BitmapComposer::DoCompose(uint8_t* dest_scan, const uint8_t* src_scan, m_pAddClipScan[i] = clip_scan[i] * m_BitmapAlpha / 255; } } else { - FXSYS_memset8(m_pAddClipScan, m_BitmapAlpha, dest_width); + FXSYS_memset(m_pAddClipScan, m_BitmapAlpha, dest_width); } clip_scan = m_pAddClipScan; } diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp index ef4f7e40b5..ffc161eb05 100644 --- a/core/src/fxge/dib/fx_dib_convert.cpp +++ b/core/src/fxge/dib/fx_dib_convert.cpp @@ -287,7 +287,7 @@ FX_BOOL _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int widt reset_gray = 0x00; for (int row = 0; row < height; row ++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; - FXSYS_memset8(dest_scan, reset_gray, width); + FXSYS_memset(dest_scan, reset_gray, width); const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row); for (int col = src_left; col < src_left + width; col ++) { if (src_scan[col / 8] & (1 << (7 - col % 8))) { @@ -304,7 +304,7 @@ FX_BOOL _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int widt for (int row = 0; row < height; row ++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left; - FXSYS_memcpy32(dest_scan, src_scan, width); + FXSYS_memcpy(dest_scan, src_scan, width); } return TRUE; } @@ -350,7 +350,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width } for (int row = 0; row < height; row ++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; - FXSYS_memset8(dest_scan, gray[0], width); + FXSYS_memset(dest_scan, gray[0], width); const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row); for (int col = src_left; col < src_left + width; col ++) { if (src_scan[col / 8] & (1 << (7 - col % 8))) { @@ -459,7 +459,7 @@ inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int widt if (pSrcBitmap->GetBPP() == 1) { for (int row = 0; row < height; row ++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; - FXSYS_memset32(dest_scan, 0, width); + FXSYS_memset(dest_scan, 0, width); const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row); for (int col = src_left; col < src_left + width; col ++) { if (src_scan[col / 8] & (1 << (7 - col % 8))) { @@ -472,7 +472,7 @@ inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int widt for (int row = 0; row < height; row ++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left; - FXSYS_memcpy32(dest_scan, src_scan, width); + FXSYS_memcpy(dest_scan, src_scan, width); } } } @@ -512,7 +512,7 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, dst_plt[i] = FXARGB_MAKE(0xff, r, g, b); } } else { - FXSYS_memcpy32(dst_plt, src_plt, plt_size * 4); + FXSYS_memcpy(dst_plt, src_plt, plt_size * 4); } } return TRUE; @@ -570,7 +570,7 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int des } } } - FXSYS_memcpy32(dst_plt, pPalette, sizeof(FX_DWORD) * 256); + FXSYS_memcpy(dst_plt, pPalette, sizeof(FX_DWORD) * 256); return TRUE; } FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, @@ -742,7 +742,7 @@ FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int wid for (int row = 0; row < height; row ++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3; - FXSYS_memcpy32(dest_scan, src_scan, width * 3); + FXSYS_memcpy(dest_scan, src_scan, width * 3); } } return TRUE; @@ -1009,7 +1009,7 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor } CFX_DIBitmap* pAlphaMask = NULL; if (dest_format == FXDIB_Argb) { - FXSYS_memset8(dest_buf, 0xff, dest_pitch * m_Height + 4); + FXSYS_memset(dest_buf, 0xff, dest_pitch * m_Height + 4); if (m_pAlphaMask) { for (int row = 0; row < m_Height; row ++) { uint8_t* pDstScanline = dest_buf + row * dest_pitch + 3; diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index fc36b95581..10d12a6010 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -207,7 +207,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d return; } if (dest_format == FXDIB_Rgb32) { - FXSYS_memset8(m_pDestScanline, 255, size); + FXSYS_memset(m_pDestScanline, 255, size); } m_InterPitch = (m_DestClip.Width() * m_DestBpp + 31) / 32 * 4; m_ExtraMaskPitch = (m_DestClip.Width() * 8 + 31) / 32 * 4; diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index db9b43412a..0c2b009559 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -120,7 +120,7 @@ FX_BOOL CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc) CopyPalette(pSrc->GetPalette()); CopyAlphaMask(pSrc->m_pAlphaMask); for (int row = 0; row < pSrc->GetHeight(); row ++) { - FXSYS_memcpy32(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch); + FXSYS_memcpy(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch); } return TRUE; } @@ -193,7 +193,7 @@ CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const for (int row = rect.top; row < rect.bottom; row ++) { const uint8_t* src_scan = GetScanline(row) + rect.left * m_bpp / 8; uint8_t* dest_scan = (uint8_t*)pNewBitmap->GetScanline(row - rect.top); - FXSYS_memcpy32(dest_scan, src_scan, copy_len); + FXSYS_memcpy(dest_scan, src_scan, copy_len); } } return pNewBitmap; @@ -239,7 +239,7 @@ FX_BOOL CFX_DIBSource::BuildAlphaMask() m_pAlphaMask = NULL; return FALSE; } - FXSYS_memset8(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch()); + FXSYS_memset(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch()); return TRUE; } FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const @@ -296,19 +296,19 @@ void CFX_DIBitmap::Clear(FX_DWORD color) } switch (GetFormat()) { case FXDIB_1bppMask: - FXSYS_memset8(m_pBuffer, (color & 0xff000000) ? 0xff : 0, m_Pitch * m_Height); + FXSYS_memset(m_pBuffer, (color & 0xff000000) ? 0xff : 0, m_Pitch * m_Height); break; case FXDIB_1bppRgb: { int index = FindPalette(color); - FXSYS_memset8(m_pBuffer, index ? 0xff : 0, m_Pitch * m_Height); + FXSYS_memset(m_pBuffer, index ? 0xff : 0, m_Pitch * m_Height); break; } case FXDIB_8bppMask: - FXSYS_memset8(m_pBuffer, color >> 24, m_Pitch * m_Height); + FXSYS_memset(m_pBuffer, color >> 24, m_Pitch * m_Height); break; case FXDIB_8bppRgb: { int index = FindPalette(color); - FXSYS_memset8(m_pBuffer, index, m_Pitch * m_Height); + FXSYS_memset(m_pBuffer, index, m_Pitch * m_Height); break; } case FXDIB_Rgb: @@ -316,7 +316,7 @@ void CFX_DIBitmap::Clear(FX_DWORD color) int a, r, g, b; ArgbDecode(color, a, r, g, b); if (r == g && g == b) { - FXSYS_memset8(m_pBuffer, r, m_Pitch * m_Height); + FXSYS_memset(m_pBuffer, r, m_Pitch * m_Height); } else { int byte_pos = 0; for (int col = 0; col < m_Width; col ++) { @@ -325,7 +325,7 @@ void CFX_DIBitmap::Clear(FX_DWORD color) m_pBuffer[byte_pos++] = r; } for (int row = 1; row < m_Height; row ++) { - FXSYS_memcpy32(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch); + FXSYS_memcpy(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch); } } break; @@ -337,7 +337,7 @@ void CFX_DIBitmap::Clear(FX_DWORD color) ((FX_DWORD*)m_pBuffer)[i] = color; } for (int row = 1; row < m_Height; row ++) { - FXSYS_memcpy32(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch); + FXSYS_memcpy(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch); } break; } @@ -407,7 +407,7 @@ FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int for (int row = 0; row < height; row ++) { uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp; const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp; - FXSYS_memcpy32(dest_scan, src_scan, width * Bpp); + FXSYS_memcpy(dest_scan, src_scan, width * Bpp); } } } else { @@ -498,10 +498,10 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h for (int col = 0; col < width; col ++) { int src_bitpos = src_left + col; if (src_scan[src_bitpos / 8] & (1 << (7 - src_bitpos % 8))) { - FXSYS_memcpy32(dest_color_pos, color_p, comps); + FXSYS_memcpy(dest_color_pos, color_p, comps); *dest_alpha_pos = 0xff; } else { - FXSYS_memset32(dest_color_pos, 0, comps); + FXSYS_memset(dest_color_pos, 0, comps); *dest_alpha_pos = 0; } dest_color_pos += comps; @@ -510,7 +510,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h } else { src_scan += src_left; for (int col = 0; col < width; col ++) { - FXSYS_memcpy32(dest_color_pos, color_p, comps); + FXSYS_memcpy(dest_color_pos, color_p, comps); dest_color_pos += comps; *dest_alpha_pos++ = (alpha * (*src_scan++) / 255); } @@ -534,7 +534,7 @@ void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size) if (pal_size > size) { pal_size = size; } - FXSYS_memcpy32(m_pPalette, pSrc, pal_size * sizeof(FX_DWORD)); + FXSYS_memcpy(m_pPalette, pSrc, pal_size * sizeof(FX_DWORD)); } } void CFX_DIBSource::GetPalette(FX_DWORD* pal, int alpha) const @@ -601,7 +601,7 @@ FX_BOOL CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_R } } for (int row = 0; row < m_Height; row ++) - FXSYS_memcpy32((void*)m_pAlphaMask->GetScanline(row), + FXSYS_memcpy((void*)m_pAlphaMask->GetScanline(row), pAlphaMask->GetScanline(row + rect.top) + rect.left, m_pAlphaMask->m_Pitch); } else { m_pAlphaMask->Clear(0xff000000); @@ -792,11 +792,11 @@ FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) } int Bpp = GetBPP() / 8; if (Bpp == 1) { - FXSYS_memset8(m_pBuffer, value, m_Height * m_Pitch); + FXSYS_memset(m_pBuffer, value, m_Height * m_Pitch); return TRUE; } if (destChannel == FXDIB_Alpha && m_pAlphaMask) { - FXSYS_memset8(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch()); + FXSYS_memset(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch()); return TRUE; } for (int row = 0; row < m_Height; row ++) { @@ -901,7 +901,7 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) delete pMask; return FALSE; } - FXSYS_memset8(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height); + FXSYS_memset(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height); for (int row = 0; row < m_Height; row ++) { uint8_t* src_pos = m_pBuffer + row * m_Pitch; uint8_t* dest_pos = (uint8_t*)pMask->GetScanline(row); @@ -1420,11 +1420,11 @@ CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const const uint8_t* src_scan = GetScanline(row); uint8_t* dest_scan = pDestBuffer + m_Pitch * (bYFlip ? (m_Height - row - 1) : row); if (!bXFlip) { - FXSYS_memcpy32(dest_scan, src_scan, m_Pitch); + FXSYS_memcpy(dest_scan, src_scan, m_Pitch); continue; } if (m_bpp == 1) { - FXSYS_memset32(dest_scan, 0, m_Pitch); + FXSYS_memset(dest_scan, 0, m_Pitch); for (int col = 0; col < m_Width; col ++) if (src_scan[col / 8] & (1 << (7 - col % 8))) { int dest_col = m_Width - col - 1; @@ -1463,7 +1463,7 @@ CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const const uint8_t* src_scan = m_pAlphaMask->GetScanline(row); uint8_t* dest_scan = pDestBuffer + dest_pitch * (bYFlip ? (m_Height - row - 1) : row); if (!bXFlip) { - FXSYS_memcpy32(dest_scan, src_scan, dest_pitch); + FXSYS_memcpy(dest_scan, src_scan, dest_pitch); continue; } dest_scan += (m_Width - 1); @@ -1690,10 +1690,10 @@ void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const uint8_t* dest_alpha_buf = m_pBitmap->m_pAlphaMask ? (uint8_t*)m_pBitmap->m_pAlphaMask->GetScanline(line) : NULL; if (dest_buf) { - FXSYS_memcpy32(dest_buf, scanline, m_pBitmap->GetPitch()); + FXSYS_memcpy(dest_buf, scanline, m_pBitmap->GetPitch()); } if (dest_alpha_buf) { - FXSYS_memcpy32(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch()); + FXSYS_memcpy(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch()); } } FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index b8109756e7..0f8af5f8ad 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -80,7 +80,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top; int col_end = bYFlip ? m_Width - dest_clip.top : dest_clip.bottom; if (GetBPP() == 1) { - FXSYS_memset8(dest_buf, 0xff, dest_pitch * result_height); + FXSYS_memset(dest_buf, 0xff, dest_pitch * result_height); for (int row = row_start; row < row_end; row ++) { const uint8_t* src_scan = GetScanline(row); int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left; |