summaryrefslogtreecommitdiff
path: root/core/fxge/dib
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-10 16:48:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-10 16:48:37 +0000
commit696a5293bb771d17c5f23b8ef73c0f961045ef30 (patch)
treef858bf695cf77f883ccae4ad7cfa8c0a2d45903a /core/fxge/dib
parentb0fc6e958634d919349e2a7611dd99f121e41d7d (diff)
downloadpdfium-696a5293bb771d17c5f23b8ef73c0f961045ef30.tar.xz
Make CFX_ImageTransformer::CalcData's bitmap non-const.
Change-Id: I1d5e3e73804efb0a8ed467d29777d017935a8824 Reviewed-on: https://pdfium-review.googlesource.com/39833 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/dib')
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp12
-rw-r--r--core/fxge/dib/cfx_imagetransformer.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 37f56b57dc..c41ac2bdf2 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -480,7 +480,7 @@ void CFX_ImageTransformer::DoBilinearLoop(
std::function<void(const BilinearData&, uint8_t*)> func) {
CFX_BilinearMatrix matrix_fix(cdata.matrix);
for (int row = 0; row < m_result.Height(); row++) {
- const uint8_t* dest = cdata.bitmap->GetScanline(row);
+ uint8_t* dest = cdata.bitmap->GetWritableScanline(row);
for (int col = 0; col < m_result.Width(); col++) {
BilinearData d;
d.res_x = 0;
@@ -496,7 +496,7 @@ void CFX_ImageTransformer::DoBilinearLoop(
AdjustCoords(&d.src_col_r, &d.src_row_r);
d.row_offset_l = d.src_row_l * cdata.pitch;
d.row_offset_r = d.src_row_r * cdata.pitch;
- func(d, const_cast<uint8_t*>(dest));
+ func(d, dest);
}
dest += increment;
}
@@ -509,7 +509,7 @@ void CFX_ImageTransformer::DoBicubicLoop(
std::function<void(const BicubicData&, uint8_t*)> func) {
CFX_BilinearMatrix matrix_fix(cdata.matrix);
for (int row = 0; row < m_result.Height(); row++) {
- const uint8_t* dest = cdata.bitmap->GetScanline(row);
+ uint8_t* dest = cdata.bitmap->GetWritableScanline(row);
for (int col = 0; col < m_result.Width(); col++) {
BicubicData d;
d.res_x = 0;
@@ -523,7 +523,7 @@ void CFX_ImageTransformer::DoBicubicLoop(
bicubic_get_pos_weight(d.pos_pixel, d.u_w, d.v_w, d.src_col_l,
d.src_row_l, d.res_x, d.res_y, stretch_width(),
stretch_height());
- func(d, const_cast<uint8_t*>(dest));
+ func(d, dest);
}
dest += increment;
}
@@ -536,7 +536,7 @@ void CFX_ImageTransformer::DoDownSampleLoop(
std::function<void(const DownSampleData&, uint8_t*)> func) {
CPDF_FixedMatrix matrix_fix(cdata.matrix);
for (int row = 0; row < m_result.Height(); row++) {
- const uint8_t* dest = cdata.bitmap->GetScanline(row);
+ uint8_t* dest = cdata.bitmap->GetWritableScanline(row);
for (int col = 0; col < m_result.Width(); col++) {
DownSampleData d;
d.src_col = 0;
@@ -544,7 +544,7 @@ void CFX_ImageTransformer::DoDownSampleLoop(
matrix_fix.Transform(col, row, &d.src_col, &d.src_row);
if (LIKELY(InStretchBounds(d.src_col, d.src_row))) {
AdjustCoords(&d.src_col, &d.src_row);
- func(d, const_cast<uint8_t*>(dest));
+ func(d, dest);
}
dest += increment;
}
diff --git a/core/fxge/dib/cfx_imagetransformer.h b/core/fxge/dib/cfx_imagetransformer.h
index 97dd61f9e1..a5b8841611 100644
--- a/core/fxge/dib/cfx_imagetransformer.h
+++ b/core/fxge/dib/cfx_imagetransformer.h
@@ -61,7 +61,7 @@ class CFX_ImageTransformer {
};
struct CalcData {
- const CFX_DIBitmap* bitmap;
+ CFX_DIBitmap* bitmap;
const CFX_Matrix& matrix;
const uint8_t* buf;
uint32_t pitch;