Remove DeviceType::kUnknown.
Replace the one use case in CFX_RenderDevice with DeviceType::kDisplay,
which is a sane default value.
Change-Id: I65a7e19958e3fafcb1766f4079aba5e7d584f992
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/56593
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index c7e039d..02abe9c 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -862,7 +862,7 @@
uint32_t fill_color,
uint32_t text_flags) {
int nativetext_flags = text_flags;
- if (m_DeviceType != DeviceType::kDisplay) {
+ if (GetDeviceType() != DeviceType::kDisplay) {
if (!(text_flags & FXTEXT_PRINTGRAPHICTEXT)) {
if (ShouldDrawDeviceText(pFont, text_flags) &&
m_pDeviceDriver->DrawDeviceText(
@@ -883,7 +883,7 @@
CFX_Matrix text2Device = mtText2Device;
char2device.Scale(font_size, -font_size);
if (fabs(char2device.a) + fabs(char2device.b) > 50 * 1.0f ||
- (m_DeviceType == DeviceType::kPrinter &&
+ (GetDeviceType() == DeviceType::kPrinter &&
!(text_flags & FXTEXT_PRINTIMAGETEXT))) {
if (pFont->GetFaceRec()) {
int nPathFlags =
@@ -895,7 +895,7 @@
int anti_alias = FT_RENDER_MODE_MONO;
bool bNormal = false;
if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
- if (m_DeviceType == DeviceType::kDisplay && m_bpp > 1) {
+ if (GetDeviceType() == DeviceType::kDisplay && m_bpp > 1) {
if (!CFX_GEModule::Get()->GetFontMgr()->FTLibrarySupportsHinting()) {
// Some Freetype implementations (like the one packaged with Fedora) do
// not support hinting due to patents 6219025, 6239783, 6307566,
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 5ff9130..e4b6437 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -252,7 +252,7 @@
int m_Height = 0;
int m_bpp = 0;
int m_RenderCaps = 0;
- DeviceType m_DeviceType = DeviceType::kUnknown;
+ DeviceType m_DeviceType = DeviceType::kDisplay;
FX_RECT m_ClipBox;
std::unique_ptr<RenderDeviceDriverIface> m_pDeviceDriver;
};
diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h
index 69e404b..fcca520 100644
--- a/core/fxge/renderdevicedriver_iface.h
+++ b/core/fxge/renderdevicedriver_iface.h
@@ -26,8 +26,7 @@
class TextCharPos;
struct FX_RECT;
-enum class DeviceType : uint8_t {
- kUnknown,
+enum class DeviceType : bool {
kDisplay,
kPrinter,
};