From 8b3b3f59930eb29a80b3e83c0c724a50765b21f9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 27 May 2016 23:08:28 -0700 Subject: Change IsGDIEnabled() to use a bool. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/2017293002 . --- core/fxge/win32/fx_win32_device.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index c5b32bdbfc..240fb30e9e 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -76,14 +76,13 @@ bool GetSubFontName(CFX_ByteString* name) { return false; } -FX_BOOL IsGDIEnabled() { +bool IsGDIEnabled() { // If GDI is disabled then GetDC for the desktop will fail. HDC hdc = ::GetDC(nullptr); - if (hdc) { - ::ReleaseDC(nullptr, hdc); - return TRUE; - } - return FALSE; + if (!hdc) + return false; + ::ReleaseDC(nullptr, hdc); + return true; } HPEN CreatePen(const CFX_GraphStateData* pGraphState, @@ -715,9 +714,8 @@ void CFX_GEModule::InitPlatform() { ver.dwOSVersionInfoSize = sizeof(ver); GetVersionEx(&ver); pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; - if (IsGDIEnabled()) { + if (IsGDIEnabled()) pPlatformData->m_GdiplusExt.Load(); - } m_pPlatformData = pPlatformData; m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); } -- cgit v1.2.3