summaryrefslogtreecommitdiff
path: root/core/fxge/agg
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/fxge/agg
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/fxge/agg')
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index affabba797..3d35e12e45 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -164,9 +164,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
if (dest_format == src_format) {
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = buffer + (dest_top + row) * pitch + dest_left * Bpp;
- uint8_t* src_scan =
- const_cast<uint8_t*>(pSrcBitmap->GetScanline(src_top + row)) +
- src_left * Bpp;
+ const uint8_t* src_scan =
+ pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
if (Bpp == 4) {
for (int col = 0; col < width; col++) {
FXARGB_SETDIB(dest_scan, ArgbEncode(src_scan[3], src_scan[0],
@@ -191,9 +190,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
ASSERT(src_format == FXDIB_Rgb32);
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = dest_buf + row * pitch;
- uint8_t* src_scan =
- const_cast<uint8_t*>(pSrcBitmap->GetScanline(src_top + row)) +
- src_left * 4;
+ const uint8_t* src_scan =
+ 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];
@@ -208,9 +206,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
if (src_format == FXDIB_Rgb) {
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = dest_buf + row * pitch;
- uint8_t* src_scan =
- const_cast<uint8_t*>(pSrcBitmap->GetScanline(src_top + row)) +
- src_left * 3;
+ const uint8_t* src_scan =
+ pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
for (int col = 0; col < width; col++) {
FXARGB_SETDIB(dest_scan,
ArgbEncode(0xff, src_scan[0], src_scan[1], src_scan[2]));
@@ -225,9 +222,8 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
ASSERT(dest_format == FXDIB_Argb);
for (int row = 0; row < height; row++) {
uint8_t* dest_scan = dest_buf + row * pitch;
- uint8_t* src_scan =
- const_cast<uint8_t*>(pSrcBitmap->GetScanline(src_top + row)) +
- src_left * 4;
+ const uint8_t* src_scan =
+ pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col++) {
FXARGB_SETDIB(dest_scan,
ArgbEncode(0xff, src_scan[0], src_scan[1], src_scan[2]));