Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2259)

Unified Diff: core/src/fxge/win32/fx_win32_device.cpp

Issue 801913002: Simplify PDFium by removing code that's not used in the open source repo. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxge/win32/fx_win32_device.cpp
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index d82102462a91a920b6d013563fb0205feedbfbd5..06e9777650b5490924483eefd0122190ae3aeff7 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -391,12 +391,10 @@ FX_BOOL CWin32FontInfo::GetFontCharset(void* hFont, int& charset)
charset = tm.tmCharSet;
return TRUE;
}
-#ifndef _FPDFAPI_MINI_
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
return FX_NEW CWin32FontInfo;
}
-#endif
void CFX_GEModule::InitPlatform()
{
CWin32Platform* pPlatformData = FX_NEW CWin32Platform;
@@ -571,29 +569,29 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int d
bmi.bmiColors[0] = 0xffffff;
bmi.bmiColors[1] = 0;
- HBRUSH hPattern = CreateSolidBrush(bitmap_color & 0xffffff);
- HBRUSH hOld = (HBRUSH)SelectObject(m_hDC, hPattern);
-
-
- // In PDF, when image mask is 1, use device bitmap; when mask is 0, use brush bitmap.
- // A complete list of the boolen operations is as follows:
-
- /* P(bitmap_color) S(ImageMask) D(DeviceBitmap) Result
- * 0 0 0 0
- * 0 0 1 0
- * 0 1 0 0
- * 0 1 1 1
- * 1 0 0 1
- * 1 0 1 1
- * 1 1 0 0
- * 1 1 1 1
- */
- // The boolen codes is B8. Based on http://msdn.microsoft.com/en-us/library/aa932106.aspx, the ROP3 code is 0xB8074A
-
- ::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
- 0, 0, width, height, pBitmap->GetBuffer(), (BITMAPINFO*)&bmi, DIB_RGB_COLORS, 0xB8074A);
-
- SelectObject(m_hDC, hOld);
+ HBRUSH hPattern = CreateSolidBrush(bitmap_color & 0xffffff);
+ HBRUSH hOld = (HBRUSH)SelectObject(m_hDC, hPattern);
+
+
+ // In PDF, when image mask is 1, use device bitmap; when mask is 0, use brush bitmap.
+ // A complete list of the boolen operations is as follows:
+
+ /* P(bitmap_color) S(ImageMask) D(DeviceBitmap) Result
+ * 0 0 0 0
+ * 0 0 1 0
+ * 0 1 0 0
+ * 0 1 1 1
+ * 1 0 0 1
+ * 1 0 1 1
+ * 1 1 0 0
+ * 1 1 1 1
+ */
+ // The boolen codes is B8. Based on http://msdn.microsoft.com/en-us/library/aa932106.aspx, the ROP3 code is 0xB8074A
+
+ ::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
+ 0, 0, width, height, pBitmap->GetBuffer(), (BITMAPINFO*)&bmi, DIB_RGB_COLORS, 0xB8074A);
+
+ SelectObject(m_hDC, hOld);
DeleteObject(hPattern);
return TRUE;
@@ -979,11 +977,9 @@ FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, v
ret = FALSE;
}
}
-#ifndef _FPDFAPI_MINI_
if (pBitmap->HasAlpha() && ret) {
pBitmap->LoadChannel(FXDIB_Alpha, 0xff);
}
-#endif
DeleteObject(hbmp);
DeleteObject(hDCMemory);
return ret;
@@ -1175,11 +1171,9 @@ IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_BOOL bCmykOu
} else {
device_class = FXDC_DISPLAY;
}
-#ifndef _FPDFAPI_MINI_
if (device_class == FXDC_PRINTER) {
return FX_NEW CGdiPrinterDriver(hDC);
}
-#endif
return FX_NEW CGdiDisplayDriver(hDC);
}
CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format format)

Powered by Google App Engine
This is Rietveld 408576698