Remove core/fxge/win32/win32_int.h.
Bug: pdfium:1474
Change-Id: I447d1e6bc7e8425abe2a8988a76ad83505a0924d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74812
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 2c5d6ed..3e24966 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -201,7 +201,6 @@
"win32/cwin32_platform.h",
"win32/fx_win32_device.cpp",
"win32/fx_win32_dib.cpp",
- "win32/win32_int.h",
]
configs -= [ "//build/config/win:lean_and_mean" ]
}
diff --git a/core/fxge/win32/cfx_windowsdib.h b/core/fxge/win32/cfx_windowsdib.h
index 184b197..2e1c341 100644
--- a/core/fxge/win32/cfx_windowsdib.h
+++ b/core/fxge/win32/cfx_windowsdib.h
@@ -29,7 +29,9 @@
static ByteString GetBitmapInfo(const RetainPtr<CFX_DIBitmap>& pBitmap);
static HBITMAP GetDDBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap, HDC hDC);
- static RetainPtr<CFX_DIBitmap> LoadFromBuf(BITMAPINFO* pbmi, void* pData);
+ static RetainPtr<CFX_DIBitmap> LoadFromBuf(BITMAPINFO* pbmi,
+ void* pData,
+ bool bAlpha);
static RetainPtr<CFX_DIBitmap> LoadFromFile(const wchar_t* filename);
static RetainPtr<CFX_DIBitmap> LoadFromFile(const char* filename);
static RetainPtr<CFX_DIBitmap> LoadDIBitmap(WINDIB_Open_Args_ args);
diff --git a/core/fxge/win32/cgdi_plus_ext.cpp b/core/fxge/win32/cgdi_plus_ext.cpp
index c3b6698..c3dfa33 100644
--- a/core/fxge/win32/cgdi_plus_ext.cpp
+++ b/core/fxge/win32/cgdi_plus_ext.cpp
@@ -24,7 +24,6 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/win32/cfx_windowsdib.h"
#include "core/fxge/win32/cwin32_platform.h"
-#include "core/fxge/win32/win32_int.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -992,7 +991,7 @@
dest_pitch);
}
}
- RetainPtr<CFX_DIBitmap> pDIBitmap = FX_WindowsDIB_LoadFromBuf(
+ RetainPtr<CFX_DIBitmap> pDIBitmap = CFX_WindowsDIB::LoadFromBuf(
pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32);
FX_Free(pData);
FreeDIBitmap(pInfo);
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index c771013..d48626d 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -4,8 +4,6 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "core/fxge/win32/win32_int.h"
-
#include <memory>
#include "core/fxcrt/fx_codepage.h"
diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp
index 5448fa1..fad6e2c 100644
--- a/core/fxge/win32/fx_win32_dib.cpp
+++ b/core/fxge/win32/fx_win32_dib.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/fxge/win32/cfx_windowsdib.h"
+
#include <windows.h>
#include <vector>
@@ -11,9 +13,20 @@
#include "core/fxcrt/fx_memory_wrappers.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_gemodule.h"
-#include "core/fxge/win32/cfx_windowsdib.h"
#include "core/fxge/win32/cwin32_platform.h"
+namespace {
+
+void GetBitmapSize(HBITMAP hBitmap, int& w, int& h) {
+ BITMAP bmp;
+ GetObject(hBitmap, sizeof bmp, &bmp);
+ w = bmp.bmWidth;
+ h = bmp.bmHeight;
+}
+
+} // namespace
+
+// static
ByteString CFX_WindowsDIB::GetBitmapInfo(
const RetainPtr<CFX_DIBitmap>& pBitmap) {
int len = sizeof(BITMAPINFOHEADER);
@@ -59,9 +72,10 @@
return result;
}
-RetainPtr<CFX_DIBitmap> FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi,
- LPVOID pData,
- bool bAlpha) {
+// static
+RetainPtr<CFX_DIBitmap> CFX_WindowsDIB::LoadFromBuf(BITMAPINFO* pbmi,
+ LPVOID pData,
+ bool bAlpha) {
int width = pbmi->bmiHeader.biWidth;
int height = pbmi->bmiHeader.biHeight;
BOOL bBottomUp = true;
@@ -102,11 +116,7 @@
return pBitmap;
}
-RetainPtr<CFX_DIBitmap> CFX_WindowsDIB::LoadFromBuf(BITMAPINFO* pbmi,
- LPVOID pData) {
- return FX_WindowsDIB_LoadFromBuf(pbmi, pData, false);
-}
-
+// static
HBITMAP CFX_WindowsDIB::GetDDBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap,
HDC hDC) {
ByteString info = GetBitmapInfo(pBitmap);
@@ -115,13 +125,7 @@
DIB_RGB_COLORS);
}
-void GetBitmapSize(HBITMAP hBitmap, int& w, int& h) {
- BITMAP bmp;
- GetObject(hBitmap, sizeof bmp, &bmp);
- w = bmp.bmWidth;
- h = bmp.bmHeight;
-}
-
+// static
RetainPtr<CFX_DIBitmap> CFX_WindowsDIB::LoadFromFile(const wchar_t* filename) {
auto* pPlatform =
static_cast<CWin32Platform*>(CFX_GEModule::Get()->GetPlatform());
@@ -154,10 +158,12 @@
return pDIBitmap;
}
+// static
RetainPtr<CFX_DIBitmap> CFX_WindowsDIB::LoadFromFile(const char* filename) {
return LoadFromFile(WideString::FromDefANSI(filename).c_str());
}
+// static
RetainPtr<CFX_DIBitmap> CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) {
auto* pPlatform =
static_cast<CWin32Platform*>(CFX_GEModule::Get()->GetPlatform());
@@ -212,6 +218,7 @@
DeleteObject(m_hBitmap);
}
+// static
void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top) {
::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY);
}
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h
deleted file mode 100644
index 0b9d80b..0000000
--- a/core/fxge/win32/win32_int.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef CORE_FXGE_WIN32_WIN32_INT_H_
-#define CORE_FXGE_WIN32_WIN32_INT_H_
-
-#include <windows.h>
-
-#include "core/fxcrt/retain_ptr.h"
-
-class CFX_DIBitmap;
-
-RetainPtr<CFX_DIBitmap> FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi,
- LPVOID pData,
- bool bAlpha);
-
-#endif // CORE_FXGE_WIN32_WIN32_INT_H_