summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-22 07:29:08 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-22 07:29:08 -0700
commit726b3db9b05c785923c65a260c59a9a9190c29e0 (patch)
tree9ac0909d9992af059ed4655bc062f46b9205a3c9 /core/fxge/win32
parentca0bc7deead753698af70dced5e619176e37c65a (diff)
downloadpdfium-726b3db9b05c785923c65a260c59a9a9190c29e0.tar.xz
Remove some fx_dib functions with unused parameters.
Review-Url: https://codereview.chromium.org/2075383002
Diffstat (limited to 'core/fxge/win32')
-rw-r--r--core/fxge/win32/fx_win32_device.cpp38
-rw-r--r--core/fxge/win32/fx_win32_print.cpp12
-rw-r--r--core/fxge/win32/win32_int.h10
3 files changed, 21 insertions, 39 deletions
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 9087478837..0b08bba8df 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -784,17 +784,14 @@ void CGdiDeviceDriver::RestoreState(bool bKeepSaved) {
FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(CFX_DIBitmap* pBitmap1,
const FX_RECT* pSrcRect,
int left,
- int top,
- void* pIccTransform) {
+ int top) {
if (m_DeviceClass == FXDC_PRINTER) {
std::unique_ptr<CFX_DIBitmap> pBitmap(pBitmap1->FlipImage(FALSE, TRUE));
if (!pBitmap)
return FALSE;
- if ((pBitmap->IsCmykImage() || pIccTransform) &&
- !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
+ if (pBitmap->IsCmykImage() && !pBitmap->ConvertFormat(FXDIB_Rgb))
return FALSE;
- }
int width = pSrcRect->Width(), height = pSrcRect->Height();
LPBYTE pBuffer = pBitmap->GetBuffer();
@@ -809,8 +806,8 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(CFX_DIBitmap* pBitmap1,
DIB_RGB_COLORS, SRCCOPY);
} else {
CFX_DIBitmap* pBitmap = pBitmap1;
- if (pBitmap->IsCmykImage() || pIccTransform) {
- pBitmap = pBitmap->CloneConvert(FXDIB_Rgb, nullptr, pIccTransform);
+ if (pBitmap->IsCmykImage()) {
+ pBitmap = pBitmap->CloneConvert(FXDIB_Rgb);
if (!pBitmap)
return FALSE;
}
@@ -833,16 +830,14 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(CFX_DIBitmap* pBitmap1,
int dest_top,
int dest_width,
int dest_height,
- uint32_t flags,
- void* pIccTransform) {
+ uint32_t flags) {
CFX_DIBitmap* pBitmap = pBitmap1;
if (!pBitmap || dest_width == 0 || dest_height == 0)
return FALSE;
- if ((pBitmap->IsCmykImage() || pIccTransform) &&
- !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
+ if (pBitmap->IsCmykImage() && !pBitmap->ConvertFormat(FXDIB_Rgb))
return FALSE;
- }
+
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
if ((int64_t)abs(dest_width) * abs(dest_height) <
(int64_t)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 ||
@@ -866,9 +861,8 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(CFX_DIBitmap* pBitmap1,
pToStrechBitmap->GetBuffer(),
(BITMAPINFO*)toStrechBitmapInfo.c_str(), DIB_RGB_COLORS,
SRCCOPY);
- if (del) {
+ if (del)
delete pToStrechBitmap;
- }
return TRUE;
}
@@ -878,14 +872,11 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(CFX_DIBitmap* pBitmap1,
int dest_width,
int dest_height,
uint32_t bitmap_color,
- uint32_t flags,
- int alpha_flag,
- void* pIccTransform) {
+ uint32_t flags) {
CFX_DIBitmap* pBitmap = pBitmap1;
if (!pBitmap || dest_width == 0 || dest_height == 0)
return FALSE;
- Color2Argb(bitmap_color, bitmap_color, alpha_flag | (1 << 24), pIccTransform);
int width = pBitmap->GetWidth(), height = pBitmap->GetHeight();
struct {
BITMAPINFOHEADER bmiHeader;
@@ -999,8 +990,6 @@ FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
if (blend_type != FXDIB_BLEND_NORMAL)
return FALSE;
- Color2Argb(fill_color, fill_color, 1 << 24, nullptr);
- Color2Argb(stroke_color, stroke_color, 0, nullptr);
CWin32Platform* pPlatform =
(CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
if (!(pGraphState || stroke_color == 0) &&
@@ -1101,7 +1090,6 @@ FX_BOOL CGdiDeviceDriver::FillRectWithBlend(const FX_RECT* pRect,
if (blend_type != FXDIB_BLEND_NORMAL)
return FALSE;
- Color2Argb(fill_color, fill_color, 1 << 24, nullptr);
int alpha;
FX_COLORREF rgb;
ArgbDecode(fill_color, alpha, rgb);
@@ -1158,7 +1146,6 @@ FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
if (blend_type != FXDIB_BLEND_NORMAL)
return FALSE;
- Color2Argb(color, color, 1 << 24, nullptr);
int a;
FX_COLORREF rgb;
ArgbDecode(color, a, rgb);
@@ -1210,8 +1197,7 @@ FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) {
bmi.bmiHeader.biBitCount = 24;
::GetDIBits(hDCMemory, hbmp, 0, height, bitmap.GetBuffer(), &bmi,
DIB_RGB_COLORS);
- ret =
- pBitmap->TransferBitmap(0, 0, width, height, &bitmap, 0, 0, nullptr);
+ ret = pBitmap->TransferBitmap(0, 0, width, height, &bitmap, 0, 0);
} else {
ret = FALSE;
}
@@ -1270,7 +1256,7 @@ FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource,
CFX_DIBitmap* pBitmap = temp;
if (!pBitmap)
return FALSE;
- return GDI_SetDIBits(pBitmap, pSrcRect, left, top, nullptr);
+ return GDI_SetDIBits(pBitmap, pSrcRect, left, top);
}
FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource,
@@ -1364,7 +1350,7 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource,
if (!pBitmap)
return FALSE;
return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width,
- dest_height, flags, nullptr);
+ dest_height, flags);
}
FX_BOOL CGdiDisplayDriver::StartDIBits(const CFX_DIBSource* pBitmap,
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp
index 02569edc38..aef6062e73 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -55,7 +55,7 @@ FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource,
if (!pBitmap)
return FALSE;
- return GDI_SetDIBits(pBitmap, pSrcRect, left, top, nullptr);
+ return GDI_SetDIBits(pBitmap, pSrcRect, left, top);
}
FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource,
@@ -84,8 +84,8 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource,
dest_top += dest_height;
return GDI_StretchBitMask(pFlipped.get(), dest_left, dest_top,
- abs(dest_width), abs(dest_height), color, flags,
- 0, nullptr);
+ abs(dest_width), abs(dest_height), color,
+ flags);
}
CFX_DIBExtractor temp(pSource);
@@ -93,7 +93,7 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource,
if (!pBitmap)
return FALSE;
return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width,
- dest_height, color, flags, 0, nullptr);
+ dest_height, color, flags);
}
if (pSource->HasAlpha())
@@ -111,7 +111,7 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource,
dest_top += dest_height;
return GDI_StretchDIBits(pFlipped.get(), dest_left, dest_top,
- abs(dest_width), abs(dest_height), flags, nullptr);
+ abs(dest_width), abs(dest_height), flags);
}
CFX_DIBExtractor temp(pSource);
@@ -119,7 +119,7 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource,
if (!pBitmap)
return FALSE;
return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width,
- dest_height, flags, nullptr);
+ dest_height, flags);
}
FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource,
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h
index 9744324008..e844f5cf24 100644
--- a/core/fxge/win32/win32_int.h
+++ b/core/fxge/win32/win32_int.h
@@ -148,24 +148,20 @@ class CGdiDeviceDriver : public IFX_RenderDeviceDriver {
FX_BOOL GDI_SetDIBits(CFX_DIBitmap* pBitmap,
const FX_RECT* pSrcRect,
int left,
- int top,
- void* pIccTransform);
+ int top);
FX_BOOL GDI_StretchDIBits(CFX_DIBitmap* pBitmap,
int dest_left,
int dest_top,
int dest_width,
int dest_height,
- uint32_t flags,
- void* pIccTransform);
+ uint32_t flags);
FX_BOOL GDI_StretchBitMask(CFX_DIBitmap* pBitmap,
int dest_left,
int dest_top,
int dest_width,
int dest_height,
uint32_t bitmap_color,
- uint32_t flags,
- int alpha_flag,
- void* pIccTransform);
+ uint32_t flags);
HDC m_hDC;
int m_Width;