summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-25 22:50:41 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-25 22:50:41 +0000
commited7da31f67e93c8923669ad496126aa005a8d3a2 (patch)
tree8b4e87778c533ec86d8fc10463f27926bcd3be2e /core/fxge/win32
parentcde8b8cb0db2784d8f591fbfa7cfe7a67092b5fa (diff)
downloadpdfium-ed7da31f67e93c8923669ad496126aa005a8d3a2.tar.xz
Simplify some code in CGdiDisplayDriver.
- GDI_StretchBitMask(), which is not an override, has a flags parameter that is never used. Remove it. - StretchDIBits() checks its flags parameter and does an early return, but still continue to use it afterwards when its only possible value is 0. Replace the flags variable with 0. Change-Id: Iad63557a1c28f2b5b84260a6b5498c1d7beada7f Reviewed-on: https://pdfium-review.googlesource.com/c/44611 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge/win32')
-rw-r--r--core/fxge/win32/fx_win32_device.cpp15
-rw-r--r--core/fxge/win32/fx_win32_print.cpp4
-rw-r--r--core/fxge/win32/win32_int.h3
3 files changed, 10 insertions, 12 deletions
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 2bacc4485c..a4452e7faa 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -850,8 +850,7 @@ bool CGdiDeviceDriver::GDI_StretchBitMask(
int dest_top,
int dest_width,
int dest_height,
- uint32_t bitmap_color,
- uint32_t flags) {
+ uint32_t bitmap_color) {
RetainPtr<CFX_DIBitmap> pBitmap = pBitmap1;
if (!pBitmap || dest_width == 0 || dest_height == 0)
return false;
@@ -1287,7 +1286,7 @@ bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource,
clip_rect.Offset(-image_rect.left, -image_rect.top);
int clip_width = clip_rect.Width(), clip_height = clip_rect.Height();
RetainPtr<CFX_DIBitmap> pStretched(
- pSource->StretchTo(dest_width, dest_height, flags, &clip_rect));
+ pSource->StretchTo(dest_width, dest_height, 0, &clip_rect));
if (!pStretched)
return true;
@@ -1313,19 +1312,19 @@ bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource,
RetainPtr<CFX_DIBitmap> pBitmap = temp.GetBitmap();
if (!pBitmap)
return false;
- return pPlatform->m_GdiplusExt.StretchDIBits(
- m_hDC, pBitmap, dest_left, dest_top, dest_width, dest_height,
- pClipRect, flags);
+ return pPlatform->m_GdiplusExt.StretchDIBits(m_hDC, pBitmap, dest_left,
+ dest_top, dest_width,
+ dest_height, pClipRect, 0);
}
return UseFoxitStretchEngine(pSource, color, dest_left, dest_top,
- dest_width, dest_height, pClipRect, flags);
+ dest_width, dest_height, pClipRect, 0);
}
CFX_DIBExtractor temp(pSource);
RetainPtr<CFX_DIBitmap> pBitmap = temp.GetBitmap();
if (!pBitmap)
return false;
return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width,
- dest_height, flags);
+ dest_height, 0);
}
bool CGdiDisplayDriver::StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp
index fce378cd4d..aeec161bf5 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -121,7 +121,7 @@ bool CGdiPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource,
dest_top += dest_height;
return GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width),
- abs(dest_height), color, flags);
+ abs(dest_height), color);
}
CFX_DIBExtractor temp(pSource);
@@ -129,7 +129,7 @@ bool CGdiPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource,
if (!pBitmap)
return false;
return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width,
- dest_height, color, flags);
+ dest_height, color);
}
if (pSource->HasAlpha())
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h
index 43ec6056fd..db0e3894c5 100644
--- a/core/fxge/win32/win32_int.h
+++ b/core/fxge/win32/win32_int.h
@@ -112,8 +112,7 @@ class CGdiDeviceDriver : public RenderDeviceDriverIface {
int dest_top,
int dest_width,
int dest_height,
- uint32_t bitmap_color,
- uint32_t flags);
+ uint32_t bitmap_color);
HDC m_hDC;
bool m_bMetafileDCType;