diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-10 00:13:37 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-10 00:13:37 +0000 |
commit | 4174b5ab6ac9024acb9b42acbb61d628a2a679e3 (patch) | |
tree | 0d73f6ad6d85fd7fead7fdc6ddfc647479511bcd /core/fxge/dib/cfx_bitmapstorer.cpp | |
parent | fd7cede17e027a83de2aff3bc0f5ee875271e444 (diff) | |
download | pdfium-4174b5ab6ac9024acb9b42acbb61d628a2a679e3.tar.xz |
Add CFX_DIBSource::GetWritableScanline().
Remove a bunch of const_cast<uint8_t*> or equivalent. This will also
help when we convert to span<>, since casting spans is a nuisance.
Change-Id: I330e5041cbaf33a84425fc4242a3dfacf5ca8011
Reviewed-on: https://pdfium-review.googlesource.com/39831
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/dib/cfx_bitmapstorer.cpp')
-rw-r--r-- | core/fxge/dib/cfx_bitmapstorer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fxge/dib/cfx_bitmapstorer.cpp b/core/fxge/dib/cfx_bitmapstorer.cpp index f649e0caea..d5b26f28b7 100644 --- a/core/fxge/dib/cfx_bitmapstorer.cpp +++ b/core/fxge/dib/cfx_bitmapstorer.cpp @@ -25,10 +25,10 @@ void CFX_BitmapStorer::Replace(RetainPtr<CFX_DIBitmap>&& pBitmap) { void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha) { - uint8_t* dest_buf = const_cast<uint8_t*>(m_pBitmap->GetScanline(line)); + uint8_t* dest_buf = m_pBitmap->GetWritableScanline(line); uint8_t* dest_alpha_buf = m_pBitmap->m_pAlphaMask - ? const_cast<uint8_t*>(m_pBitmap->m_pAlphaMask->GetScanline(line)) + ? m_pBitmap->m_pAlphaMask->GetWritableScanline(line) : nullptr; if (dest_buf) memcpy(dest_buf, scanline, m_pBitmap->GetPitch()); |