From f1e7c461dfabbff6b65a072f24f6711b34159361 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 23 Jul 2015 13:36:00 -0700 Subject: Revert "FX_BOOL considered harmful, part 2." This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 . --- core/src/fxge/win32/fx_win32_print.cpp | 86 +++++++++++++++++----------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'core/src/fxge/win32/fx_win32_print.cpp') diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 63c3849237..86dbf9bb0a 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -18,7 +18,7 @@ CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_PRINT { m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE); - m_bSupportROP = true; + m_bSupportROP = TRUE; } int CGdiPrinterDriver::GetDeviceCaps(int caps_id) { @@ -30,7 +30,7 @@ int CGdiPrinterDriver::GetDeviceCaps(int caps_id) } return CGdiDeviceDriver::GetDeviceCaps(caps_id); } -bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform) { if (pSource->IsAlphaMask()) { @@ -41,28 +41,28 @@ bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, ASSERT(pSource != NULL && !pSource->IsAlphaMask() && pSrcRect != NULL); ASSERT(blend_type == FXDIB_BLEND_NORMAL); if (pSource->HasAlpha()) { - return false; + return FALSE; } CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return false; + return FALSE; } return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform); } -bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags, int alpha_flag, void* pIccTransform, int blend_type) { if (pSource->IsAlphaMask()) { int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); if (pSource->GetBPP() != 1 || alpha != 255 || !m_bSupportROP) { - return false; + return FALSE; } if (dest_width < 0 || dest_height < 0) { CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0); if (pFlipped == NULL) { - return false; + return FALSE; } if (dest_width < 0) { dest_left += dest_width; @@ -70,24 +70,24 @@ bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col if (dest_height < 0) { dest_top += dest_height; } - bool ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform); + FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform); delete pFlipped; return ret; } CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return false; + return FALSE; } return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest_height, color, flags, alpha_flag, pIccTransform); } if (pSource->HasAlpha()) { - return false; + return FALSE; } if (dest_width < 0 || dest_height < 0) { CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0); if (pFlipped == NULL) { - return false; + return FALSE; } if (dest_width < 0) { dest_left += dest_width; @@ -95,14 +95,14 @@ bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col if (dest_height < 0) { dest_top += dest_height; } - bool ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); + FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); delete pFlipped; return ret; } CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return false; + return FALSE; } return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform); } @@ -189,18 +189,18 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af } return pTempBitmap; } -bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color, +FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type) { if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1 || !m_bSupportROP))) { - return false; + return FALSE; } CFX_FloatRect unit_rect = pMatrix->GetUnitRect(); FX_RECT full_rect = unit_rect.GetOutterRect(); if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) { - bool bFlipX = pMatrix->a < 0; - bool bFlipY = pMatrix->d > 0; + FX_BOOL bFlipX = pMatrix->a < 0; + FX_BOOL bFlipY = pMatrix->d > 0; return StretchDIBits(pSource, color, bFlipX ? full_rect.right : full_rect.left, bFlipY ? full_rect.bottom : full_rect.top, bFlipX ? -full_rect.Width() : full_rect.Width(), bFlipY ? -full_rect.Height() : full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); @@ -208,9 +208,9 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alp if (FXSYS_fabs(pMatrix->a) < 0.5f && FXSYS_fabs(pMatrix->d) < 0.5f) { CFX_DIBitmap* pTransformed = pSource->SwapXY(pMatrix->c > 0, pMatrix->b < 0); if (pTransformed == NULL) { - return false; + return FALSE; } - bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, + FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); delete pTransformed; return ret; @@ -218,20 +218,20 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alp if (pSource->GetBPP() == 1) { CFX_DIBitmap* pTransformed = Transform1bppBitmap(pSource, pMatrix); if (pIccTransform == NULL) { - return false; + return FALSE; } SaveState(); CFX_PathData path; path.AppendRect(0, 0, 1.0f, 1.0f); SetClip_PathFill(&path, pMatrix, WINDING); - bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, + FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); RestoreState(); delete pTransformed; handle = NULL; return ret; } - return false; + return FALSE; } CPSOutput::CPSOutput(HDC hDC) { @@ -266,14 +266,14 @@ void CPSOutput::OutputPS(const FX_CHAR* string, int len) CPSPrinterDriver::CPSPrinterDriver() { m_pPSOutput = NULL; - m_bCmykOutput = false; + m_bCmykOutput = FALSE; } CPSPrinterDriver::~CPSPrinterDriver() { EndRendering(); delete m_pPSOutput; } -bool CPSPrinterDriver::Init(HDC hDC, int pslevel, bool bCmykOutput) +FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) { m_hDC = hDC; m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); @@ -305,7 +305,7 @@ bool CPSPrinterDriver::Init(HDC hDC, int pslevel, bool bCmykOutput) } } ::DeleteObject(hRgn); - return true; + return TRUE; } int CPSPrinterDriver::GetDeviceCaps(int caps_id) { @@ -327,7 +327,7 @@ int CPSPrinterDriver::GetDeviceCaps(int caps_id) } return 0; } -bool CPSPrinterDriver::StartRendering() +FX_BOOL CPSPrinterDriver::StartRendering() { return m_PSRenderer.StartRendering(); } @@ -339,69 +339,69 @@ void CPSPrinterDriver::SaveState() { m_PSRenderer.SaveState(); } -void CPSPrinterDriver::RestoreState(bool bKeepSaved) +void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved) { m_PSRenderer.RestoreState(bKeepSaved); } -bool CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, +FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode) { m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode); - return true; + return TRUE; } -bool CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData, +FX_BOOL CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState) { m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState); - return true; + return TRUE; } -bool CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData, +FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_ARGB fill_color, FX_ARGB stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return false; + return FALSE; } return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode & 3, alpha_flag, pIccTransform); } -bool CPSPrinterDriver::GetClipBox(FX_RECT* pRect) +FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect) { *pRect = m_PSRenderer.GetClipBox(); - return true; + return TRUE; } -bool CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform) { if (blend_type != FXDIB_BLEND_NORMAL) { - return false; + return FALSE; } return m_PSRenderer.SetDIBits(pBitmap, color, left, top, alpha_flag, pIccTransform); } -bool CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, +FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return false; + return FALSE; } return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top, dest_width, dest_height, flags, alpha_flag, pIccTransform); } -bool CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, +FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return false; + return FALSE; } if (bitmap_alpha < 255) { - return false; + return FALSE; } handle = NULL; return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_flag, pIccTransform); } -bool CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, +FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, int alpha_flag, void* pIccTransform) { -- cgit v1.2.3