From 12f3e4a58f05850b93af35619cb04f0231d86acc Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 2 Nov 2016 15:17:29 -0700 Subject: Remove FX_BOOL from core Review-Url: https://codereview.chromium.org/2477443002 --- core/fxge/ge/cfx_pathdata.cpp | 74 +++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'core/fxge/ge/cfx_pathdata.cpp') diff --git a/core/fxge/ge/cfx_pathdata.cpp b/core/fxge/ge/cfx_pathdata.cpp index 73476bf271..19e8bdb013 100644 --- a/core/fxge/ge/cfx_pathdata.cpp +++ b/core/fxge/ge/cfx_pathdata.cpp @@ -160,8 +160,8 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT miter_limit) { FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0; - FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20; - FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20; + bool bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20; + bool bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20; if (bStartVert && bEndVert) { int start_dir = middle_y > start_y ? 1 : -1; FX_FLOAT point_y = middle_y + half_width * start_dir; @@ -251,12 +251,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, int iStartPoint = 0; int iEndPoint = 0; int iMiddlePoint = 0; - FX_BOOL bJoin; + bool bJoin; while (iPoint < m_PointCount) { if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) { iStartPoint = iPoint + 1; iEndPoint = iPoint; - bJoin = FALSE; + bJoin = false; } else { if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) { rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY); @@ -268,12 +268,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) { iStartPoint = iPoint - 1; iEndPoint = iPoint; - bJoin = FALSE; + bJoin = false; } else { iStartPoint = iPoint - 1; iMiddlePoint = iPoint; iEndPoint = iPoint + 1; - bJoin = TRUE; + bJoin = true; } } FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX; @@ -302,12 +302,12 @@ void CFX_PathData::Transform(const CFX_Matrix* pMatrix) { } } -FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, - CFX_Matrix* pMatrix, - FX_BOOL& bThin, - FX_BOOL bAdjust) const { +bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, + CFX_Matrix* pMatrix, + bool& bThin, + bool bAdjust) const { if (m_PointCount < 3) { - return FALSE; + return false; } if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO && (m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && @@ -344,13 +344,13 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, } if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) { - bThin = TRUE; + bThin = true; } - return TRUE; + return true; } if (((m_PointCount > 3) && (m_PointCount % 2))) { int mid = m_PointCount / 2; - FX_BOOL bZeroArea = FALSE; + bool bZeroArea = false; CFX_PathData t_path; for (int i = 0; i < mid; i++) { if (!(m_pPoints[mid - i - 1].m_PointX == @@ -359,7 +359,7 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, m_pPoints[mid + i + 1].m_PointY && ((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) { - bZeroArea = TRUE; + bZeroArea = true; break; } int new_count = t_path.GetPointCount(); @@ -371,8 +371,8 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, } if (!bZeroArea) { NewPath.Append(&t_path, nullptr); - bThin = TRUE; - return TRUE; + bThin = true; + return true; } } int stratPoint = 0; @@ -430,7 +430,7 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, m_pPoints[i - 1].m_PointY, FXPT_MOVETO); NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO); - bThin = TRUE; + bThin = true; } } } else if (point_type == FXPT_BEZIERTO) { @@ -439,17 +439,17 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, } } if (m_PointCount > 3 && NewPath.GetPointCount()) { - bThin = TRUE; + bThin = true; } if (NewPath.GetPointCount() == 0) { - return FALSE; + return false; } - return TRUE; + return true; } -FX_BOOL CFX_PathData::IsRect() const { +bool CFX_PathData::IsRect() const { if (m_PointCount != 5 && m_PointCount != 4) { - return FALSE; + return false; } if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) || @@ -457,29 +457,29 @@ FX_BOOL CFX_PathData::IsRect() const { m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) || (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) { - return FALSE; + return false; } if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) { - return FALSE; + return false; } for (int i = 1; i < 4; i++) { if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) { - return FALSE; + return false; } if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) { - return FALSE; + return false; } } return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE); } -FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, - CFX_FloatRect* pRect) const { +bool CFX_PathData::IsRect(const CFX_Matrix* pMatrix, + CFX_FloatRect* pRect) const { if (!pMatrix) { if (!IsRect()) { - return FALSE; + return false; } if (pRect) { pRect->left = m_pPoints[0].m_PointX; @@ -488,20 +488,20 @@ FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, pRect->top = m_pPoints[2].m_PointY; pRect->Normalize(); } - return TRUE; + return true; } if (m_PointCount != 5 && m_PointCount != 4) { - return FALSE; + return false; } if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) || (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) { - return FALSE; + return false; } if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) { - return FALSE; + return false; } FX_FLOAT x[5], y[5]; for (int i = 0; i < m_PointCount; i++) { @@ -509,10 +509,10 @@ FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, y[i]); if (i) { if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) { - return FALSE; + return false; } if (x[i] != x[i - 1] && y[i] != y[i - 1]) { - return FALSE; + return false; } } } @@ -523,7 +523,7 @@ FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, pRect->top = y[2]; pRect->Normalize(); } - return TRUE; + return true; } void CFX_PathData::Copy(const CFX_PathData& src) { -- cgit v1.2.3