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

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

Issue 2197513004: Refactor fxge/fx_apple and fx_win header files (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fixing nits Created 4 years, 5 months 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
« no previous file with comments | « core/fxge/win32/cfx_windowsdib.h ('k') | core/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/win32/fx_win32_device.cpp
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 8a8be62f7bf48b5435a9c3bd2231ec1b24bd014b..20b277e3f7efd4289949dfcf16d53127512038ee 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -24,10 +24,11 @@
#include "core/fxge/ge/cfx_folderfontinfo.h"
#include "core/fxge/ge/fx_text_int.h"
#include "core/fxge/include/cfx_fontmapper.h"
+#include "core/fxge/include/cfx_windowsdevice.h"
#include "core/fxge/include/ifx_systemfontinfo.h"
#include "core/fxge/include/fx_font.h"
#include "core/fxge/include/fx_freetype.h"
-#include "core/fxge/include/fx_ge_win32.h"
+#include "core/fxge/win32/cfx_windowsdib.h"
#include "core/fxge/win32/dwrite_int.h"
#include "core/fxge/win32/win32_int.h"
#include "third_party/base/stl_util.h"
@@ -1389,39 +1390,4 @@ IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) {
return new CGdiDisplayDriver(hDC);
}
-CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width,
- int height,
- FXDIB_Format format) {
- BITMAPINFOHEADER bmih;
- FXSYS_memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
- bmih.biSize = sizeof(BITMAPINFOHEADER);
- bmih.biBitCount = format & 0xff;
- bmih.biHeight = -height;
- bmih.biPlanes = 1;
- bmih.biWidth = width;
- void* pBufferPtr;
- m_hBitmap = CreateDIBSection(nullptr, reinterpret_cast<BITMAPINFO*>(&bmih),
- DIB_RGB_COLORS, &pBufferPtr, nullptr, 0);
- if (!m_hBitmap)
- return;
-
- uint8_t* pBuffer = static_cast<uint8_t*>(pBufferPtr);
- CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
- pBitmap->Create(width, height, format, pBuffer);
- SetBitmap(pBitmap);
- m_hDC = ::CreateCompatibleDC(nullptr);
- m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
- SetDeviceDriver(WrapUnique(new CGdiDisplayDriver(m_hDC)));
-}
-
-CFX_WinBitmapDevice::~CFX_WinBitmapDevice() {
- if (m_hDC) {
- SelectObject(m_hDC, m_hOldBitmap);
- DeleteDC(m_hDC);
- }
- if (m_hBitmap)
- DeleteObject(m_hBitmap);
- delete GetBitmap();
-}
-
#endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
« no previous file with comments | « core/fxge/win32/cfx_windowsdib.h ('k') | core/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698