summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_imagerenderer.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-10 00:13:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-10 00:13:37 +0000
commit4174b5ab6ac9024acb9b42acbb61d628a2a679e3 (patch)
tree0d73f6ad6d85fd7fead7fdc6ddfc647479511bcd /core/fpdfapi/render/cpdf_imagerenderer.cpp
parentfd7cede17e027a83de2aff3bc0f5ee875271e444 (diff)
downloadpdfium-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/fpdfapi/render/cpdf_imagerenderer.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_imagerenderer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index d3e7075cc2..c7334f6ad3 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -247,8 +247,7 @@ void CPDF_ImageRenderer::CalculateDrawImage(
int matte_g = FXARGB_G(m_Loader.m_MatteColor);
int matte_b = FXARGB_B(m_Loader.m_MatteColor);
for (int row = 0; row < rect.Height(); row++) {
- uint8_t* dest_scan =
- const_cast<uint8_t*>(pBitmapDevice1->GetBitmap()->GetScanline(row));
+ uint8_t* dest_scan = pBitmapDevice1->GetBitmap()->GetWritableScanline(row);
const uint8_t* mask_scan = pBitmapDevice2->GetBitmap()->GetScanline(row);
for (int col = 0; col < rect.Width(); col++) {
int alpha = *mask_scan++;