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/ge/fx_ge_device.cpp | 94 +++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'core/src/fxge/ge/fx_ge_device.cpp') diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp index ecdd1b0183..0baa99cdc7 100644 --- a/core/src/fxge/ge/fx_ge_device.cpp +++ b/core/src/fxge/ge/fx_ge_device.cpp @@ -35,7 +35,7 @@ void CFX_RenderDevice::InitDeviceInfo() m_ClipBox.bottom = m_Height; } } -bool CFX_RenderDevice::StartRendering() +FX_BOOL CFX_RenderDevice::StartRendering() { return m_pDeviceDriver->StartRendering(); } @@ -47,7 +47,7 @@ void CFX_RenderDevice::SaveState() { m_pDeviceDriver->SaveState(); } -void CFX_RenderDevice::RestoreState(bool bKeepSaved) +void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved) { m_pDeviceDriver->RestoreState(bKeepSaved); UpdateClipBox(); @@ -60,7 +60,7 @@ CFX_Matrix CFX_RenderDevice::GetCTM() const { return m_pDeviceDriver->GetCTM(); } -bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const +FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const { if (m_RenderCaps & FXRC_CMYK_OUTPUT) { return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka : FXDIB_Cmyk); @@ -74,37 +74,37 @@ bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb); #endif } -bool CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData, +FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ) { if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) { - return false; + return FALSE; } UpdateClipBox(); - return true; + return TRUE; } -bool CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData, +FX_BOOL CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ) { if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) { - return false; + return FALSE; } UpdateClipBox(); - return true; + return TRUE; } -bool CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect) +FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect) { CFX_PathData path; path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top)); if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) { - return false; + return FALSE; } UpdateClipBox(); - return true; + return TRUE; } void CFX_RenderDevice::UpdateClipBox() { @@ -116,7 +116,7 @@ void CFX_RenderDevice::UpdateClipBox() m_ClipBox.right = m_Width; m_ClipBox.bottom = m_Height; } -bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, +FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode, @@ -149,7 +149,7 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, y2 = pPoints[1].m_PointY; } DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, alpha_flag, pIccTransform, blend_type); - return true; + return TRUE; } if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) { CFX_FloatRect rect_f; @@ -184,13 +184,13 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, } } if (FillRect(&rect_i, fill_color, alpha_flag, pIccTransform, blend_type)) { - return true; + return TRUE; } } } if((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) { CFX_PathData newPath; - bool bThin = false; + FX_BOOL bThin = FALSE; if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, m_pDeviceDriver->GetDriverType())) { CFX_GraphStateData graphState; graphState.m_LineWidth = 0.0f; @@ -215,7 +215,7 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, } if ((fill_mode & 3) && fill_alpha && stroke_alpha < 0xff && (fill_mode & FX_FILL_STROKE)) { if (!(m_RenderCaps & FXRC_GET_BITS)) { - return false; + return FALSE; } CFX_FloatRect bbox; if (pGraphState) { @@ -232,19 +232,19 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, FX_RECT rect = bbox.GetOutterRect(); CFX_DIBitmap bitmap, Backdrop; if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) { - return false; + return FALSE; } if (bitmap.HasAlpha()) { bitmap.Clear(0); Backdrop.Copy(&bitmap); } else { if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top, NULL)) { - return false; + return FALSE; } Backdrop.Copy(&bitmap); } CFX_FxgeDevice bitmap_device; - bitmap_device.Attach(&bitmap, 0, false, &Backdrop, true); + bitmap_device.Attach(&bitmap, 0, FALSE, &Backdrop, TRUE); CFX_AffineMatrix matrix; if (pObject2Device) { matrix = *pObject2Device; @@ -252,51 +252,51 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData, matrix.TranslateI(-rect.left, -rect.top); matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0); if (!bitmap_device.GetDeviceDriver()->DrawPath(pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) { - return false; + return FALSE; } FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY)); return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, FXDIB_BLEND_NORMAL); } return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type); } -bool CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform) +FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform) { if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) { - return true; + return TRUE; } FX_RECT rect(x, y, x + 1, y + 1); return FillRect(&rect, color, alpha_flag, pIccTransform); } -bool CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type) +FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type) { if (m_pDeviceDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform, blend_type)) { - return true; + return TRUE; } if (!(m_RenderCaps & FXRC_GET_BITS)) { - return false; + return FALSE; } CFX_DIBitmap bitmap; if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) { - return false; + return FALSE; } if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) { - return false; + return FALSE; } if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, alpha_flag, pIccTransform)) { - return false; + return FALSE; } FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height()); m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL); - return true; + return TRUE; } -bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, +FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) { if (((m_RenderCaps & FXRC_ALPHA_PATH) && (FXGETFLAG_COLORTYPE(alpha_flag) && FXGETFLAG_ALPHA_FILL(alpha_flag) == 0xff)) || color >= 0xff000000) if (m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, alpha_flag, pIccTransform, blend_type)) { - return true; + return TRUE; } CFX_GraphStateData graph_state; CFX_PathData path; @@ -305,10 +305,10 @@ bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, F path.SetPoint(1, x2, y2, FXPT_LINETO); return m_pDeviceDriver->DrawPath(&path, NULL, &graph_state, 0, color, fill_mode, alpha_flag, pIccTransform, blend_type); } -bool CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform) +FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform) { if (!(m_RenderCaps & FXRC_GET_BITS)) { - return false; + return FALSE; } return m_pDeviceDriver->GetDIBits(pBitmap, left, top, pIccTransform); } @@ -316,7 +316,7 @@ CFX_DIBitmap* CFX_RenderDevice::GetBackDrop() { return m_pDeviceDriver->GetBackDrop(); } -bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode, +FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode, void* pIccTransform) { ASSERT(!pBitmap->IsAlphaMask()); @@ -326,7 +326,7 @@ bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top FX_RECT dest_rect(left, top, FXSYS_round(left + pBitmap->GetWidth() / fScaleX), FXSYS_round(top + pBitmap->GetHeight() / fScaleY)); dest_rect.Intersect(m_ClipBox); if (dest_rect.IsEmpty()) { - return true; + return TRUE; } FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top, dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height()); @@ -337,29 +337,29 @@ bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) || (pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) { if (!(m_RenderCaps & FXRC_GET_BITS)) { - return false; + return FALSE; } int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX); int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY); CFX_DIBitmap background; if (!background.Create(bg_pixel_width, bg_pixel_height, (m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) { - return false; + return FALSE; } if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) { - return false; + return FALSE; } if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height, pBitmap, src_rect.left, src_rect.top, - blend_mode, NULL, false, pIccTransform)) { - return false; + blend_mode, NULL, FALSE, pIccTransform)) { + return FALSE; } FX_RECT src_rect(0, 0, bg_pixel_width, bg_pixel_height); return m_pDeviceDriver->SetDIBits(&background, 0, &src_rect, dest_rect.left, dest_rect.top, FXDIB_BLEND_NORMAL); } return m_pDeviceDriver->SetDIBits(pBitmap, 0, &src_rect, dest_rect.left, dest_rect.top, blend_mode, 0, pIccTransform); } -bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, +FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform, int blend_mode) { @@ -367,17 +367,17 @@ bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int FX_RECT clip_box = m_ClipBox; clip_box.Intersect(dest_rect); if (clip_box.IsEmpty()) { - return true; + return TRUE; } return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, 0, pIccTransform, blend_mode); } -bool CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb, +FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb, int alpha_flag, void* pIccTransform) { FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()); return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform); } -bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, +FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, FX_DWORD argb, FX_DWORD flags, int alpha_flag, void* pIccTransform) { @@ -386,13 +386,13 @@ bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, in clip_box.Intersect(dest_rect); return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform); } -bool CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb, +FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb, const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_mode) { return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode); } -bool CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) +FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { return m_pDeviceDriver->ContinueDIBits(handle, pPause); } -- cgit v1.2.3