summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-14 14:43:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 19:05:58 +0000
commit05df075154a832fcb476e1dfcfb865722d0ea898 (patch)
treeb8b771b62adae74d5d5ee561db75d10de3a848bf /xfa/fwl/theme
parent6b94f01d1c8ad386d497428c7397b1a99614aeba (diff)
downloadpdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fwl/theme')
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp32
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.h2
-rw-r--r--xfa/fwl/theme/cfwl_edittp.cpp4
-rw-r--r--xfa/fwl/theme/cfwl_pushbuttontp.cpp4
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.cpp24
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp22
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.h8
7 files changed, 48 insertions, 48 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 1d185b4c33..76a20fe14a 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -92,8 +92,8 @@ void CFWL_CheckBoxTP::DrawSignCross(CFX_Graphics* pGraphics,
FX_ARGB argbFill,
CFX_Matrix* pMatrix) {
CFX_Path path;
- FX_FLOAT fRight = pRtSign->right();
- FX_FLOAT fBottom = pRtSign->bottom();
+ float fRight = pRtSign->right();
+ float fBottom = pRtSign->bottom();
path.AddLine(pRtSign->TopLeft(), CFX_PointF(fRight, fBottom));
path.AddLine(CFX_PointF(pRtSign->left, fBottom),
CFX_PointF(fRight, pRtSign->top));
@@ -111,9 +111,9 @@ void CFWL_CheckBoxTP::DrawSignDiamond(CFX_Graphics* pGraphics,
FX_ARGB argbFill,
CFX_Matrix* pMatrix) {
CFX_Path path;
- FX_FLOAT fWidth = pRtSign->width;
- FX_FLOAT fHeight = pRtSign->height;
- FX_FLOAT fBottom = pRtSign->bottom();
+ float fWidth = pRtSign->width;
+ float fHeight = pRtSign->height;
+ float fBottom = pRtSign->bottom();
path.MoveTo(CFX_PointF(pRtSign->left + fWidth / 2, pRtSign->top));
path.LineTo(CFX_PointF(pRtSign->left, pRtSign->top + fHeight / 2));
path.LineTo(CFX_PointF(pRtSign->left + fWidth / 2, fBottom));
@@ -146,18 +146,18 @@ void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics* pGraphics,
FX_ARGB argbFill,
CFX_Matrix* pMatrix) {
CFX_Path path;
- FX_FLOAT fBottom = pRtSign->bottom();
- FX_FLOAT fRadius =
- (pRtSign->top - fBottom) / (1 + static_cast<FX_FLOAT>(cos(FX_PI / 5.0f)));
+ float fBottom = pRtSign->bottom();
+ float fRadius =
+ (pRtSign->top - fBottom) / (1 + static_cast<float>(cos(FX_PI / 5.0f)));
CFX_PointF ptCenter((pRtSign->left + pRtSign->right()) / 2.0f,
(pRtSign->top + fBottom) / 2.0f);
CFX_PointF points[5];
- FX_FLOAT fAngel = FX_PI / 10.0f;
+ float fAngel = FX_PI / 10.0f;
for (int32_t i = 0; i < 5; i++) {
points[i] =
- ptCenter + CFX_PointF(fRadius * static_cast<FX_FLOAT>(cos(fAngel)),
- fRadius * static_cast<FX_FLOAT>(sin(fAngel)));
+ ptCenter + CFX_PointF(fRadius * static_cast<float>(cos(fAngel)),
+ fRadius * static_cast<float>(sin(fAngel)));
fAngel += FX_PI * 2 / 5.0f;
}
@@ -216,13 +216,13 @@ void CFWL_CheckBoxTP::SetThemeData() {
m_pThemeData->clrSignNeutralPressed = ArgbEncode(255, 28, 134, 26);
}
-void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) {
+void CFWL_CheckBoxTP::InitCheckPath(float fCheckLen) {
if (!m_pCheckPath) {
m_pCheckPath = pdfium::MakeUnique<CFX_Path>();
- FX_FLOAT fWidth = kSignPath;
- FX_FLOAT fHeight = -kSignPath;
- FX_FLOAT fBottom = kSignPath;
+ float fWidth = kSignPath;
+ float fHeight = -kSignPath;
+ float fBottom = kSignPath;
CFX_PointF pt1(fWidth / 15.0f, fBottom + fHeight * 2 / 5.0f);
CFX_PointF pt2(fWidth / 4.5f, fBottom + fHeight / 16.0f);
CFX_PointF pt3(fWidth / 3.0f, fBottom);
@@ -262,7 +262,7 @@ void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) {
p2 = CFX_PointF(pt15.x - pt1.x, pt15.y - pt1.y) * FX_BEZIER;
m_pCheckPath->BezierTo(pt5 + p1, pt1 + p2, pt1);
- FX_FLOAT fScale = fCheckLen / kSignPath;
+ float fScale = fCheckLen / kSignPath;
CFX_Matrix mt(1, 0, 0, 1, 0, 0);
mt.Scale(fScale, fScale);
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h
index 979b970b39..1070b12598 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.h
+++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -65,7 +65,7 @@ class CFWL_CheckBoxTP : public CFWL_WidgetTP {
FX_ARGB argbFill,
CFX_Matrix* pMatrix);
- void InitCheckPath(FX_FLOAT fCheckLen);
+ void InitCheckPath(float fCheckLen);
std::unique_ptr<CKBThemeData> m_pThemeData;
std::unique_ptr<CFX_Path> m_pCheckPath;
diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp
index 43160177d7..ebc23bf129 100644
--- a/xfa/fwl/theme/cfwl_edittp.cpp
+++ b/xfa/fwl/theme/cfwl_edittp.cpp
@@ -22,7 +22,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) {
if (CFWL_Part::CombTextLine == pParams->m_iPart) {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
FX_ARGB cr = 0xFF000000;
- FX_FLOAT fWidth = 1.0f;
+ float fWidth = 1.0f;
if (CXFA_Border borderUI = pWidget->GetDataAcc()->GetUIBorder()) {
CXFA_Edge edge = borderUI.GetEdge(0);
if (edge) {
@@ -74,7 +74,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) {
}
case CFWL_Part::CombTextLine: {
FX_ARGB cr = 0xFF000000;
- FX_FLOAT fWidth = 1.0f;
+ float fWidth = 1.0f;
CFX_Color crLine(cr);
pParams->m_pGraphics->SetStrokeColor(&crLine);
pParams->m_pGraphics->SetLineWidth(fWidth);
diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
index 56268a8507..6bb34d0657 100644
--- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
@@ -29,8 +29,8 @@ void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) {
}
case CFWL_Part::Background: {
CFX_RectF& rect = pParams->m_rtPart;
- FX_FLOAT fRight = rect.right();
- FX_FLOAT fBottom = rect.bottom();
+ float fRight = rect.right();
+ float fBottom = rect.bottom();
CFX_Path strokePath;
strokePath.MoveTo(
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 121d4dea34..bab9a3f3be 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -124,13 +124,13 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
CFX_Path path;
if (bVert) {
- FX_FLOAT fPawLen = kPawLength;
+ float fPawLen = kPawLength;
if (pRect->width / 2 <= fPawLen) {
fPawLen = (pRect->width - 6) / 2;
}
- FX_FLOAT fX = pRect->left + pRect->width / 4;
- FX_FLOAT fY = pRect->top + pRect->height / 2;
+ float fX = pRect->left + pRect->width / 4;
+ float fY = pRect->top + pRect->height / 2;
path.MoveTo(CFX_PointF(fX, fY - 4));
path.LineTo(CFX_PointF(fX + fPawLen, fY - 4));
path.MoveTo(CFX_PointF(fX, fY - 2));
@@ -161,13 +161,13 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
pGraphics->SetStrokeColor(&clrDark);
pGraphics->StrokePath(&path, pMatrix);
} else {
- FX_FLOAT fPawLen = kPawLength;
+ float fPawLen = kPawLength;
if (pRect->height / 2 <= fPawLen) {
fPawLen = (pRect->height - 6) / 2;
}
- FX_FLOAT fX = pRect->left + pRect->width / 2;
- FX_FLOAT fY = pRect->top + pRect->height / 4;
+ float fX = pRect->left + pRect->width / 2;
+ float fY = pRect->top + pRect->height / 4;
path.MoveTo(CFX_PointF(fX - 4, fY));
path.LineTo(CFX_PointF(fX - 4, fY + fPawLen));
path.MoveTo(CFX_PointF(fX - 2, fY));
@@ -212,8 +212,8 @@ void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics,
pGraphics->SaveGraphState();
CFX_Color colorLine(ArgbEncode(255, 238, 237, 229));
CFX_Path path;
- FX_FLOAT fRight = pRect->right();
- FX_FLOAT fBottom = pRect->bottom();
+ float fRight = pRect->right();
+ float fBottom = pRect->bottom();
if (bVert) {
path.AddRectangle(pRect->left, pRect->top, 1, pRect->height);
path.AddRectangle(fRight - 1, pRect->top, 1, pRect->height);
@@ -226,10 +226,10 @@ void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics,
path.Clear();
path.AddRectangle(pRect->left + 1, pRect->top, pRect->width - 2,
pRect->height);
- FX_FLOAT x1 = bVert ? pRect->left + 1 : pRect->left;
- FX_FLOAT y1 = bVert ? pRect->top : pRect->top + 1;
- FX_FLOAT x2 = bVert ? fRight - 1 : pRect->left;
- FX_FLOAT y2 = bVert ? pRect->top : fBottom - 1;
+ float x1 = bVert ? pRect->left + 1 : pRect->left;
+ float y1 = bVert ? pRect->top : pRect->top + 1;
+ float x2 = bVert ? fRight - 1 : pRect->left;
+ float y2 = bVert ? pRect->top : fBottom - 1;
pGraphics->RestoreGraphState();
DrawAxialShading(pGraphics, x1, y1, x2, y2, m_pThemeData->clrTrackBKStart,
m_pThemeData->clrTrackBKEnd, &path, FXFILL_WINDING, pMatrix);
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index fbcbcffb85..6ce86fb269 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -138,10 +138,10 @@ void CFWL_WidgetTP::FillSoildRect(CFX_Graphics* pGraphics,
}
void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics* pGraphics,
- FX_FLOAT fx1,
- FX_FLOAT fy1,
- FX_FLOAT fx2,
- FX_FLOAT fy2,
+ float fx1,
+ float fy1,
+ float fx2,
+ float fy2,
FX_ARGB beginColor,
FX_ARGB endColor,
CFX_Path* path,
@@ -170,7 +170,7 @@ void CFWL_WidgetTP::DrawFocus(CFX_Graphics* pGraphics,
pGraphics->SaveGraphState();
CFX_Color cr(0xFF000000);
pGraphics->SetStrokeColor(&cr);
- FX_FLOAT DashPattern[2] = {1, 1};
+ float DashPattern[2] = {1, 1};
pGraphics->SetLineDash(0.0f, DashPattern, 2);
CFX_Path path;
path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
@@ -185,10 +185,10 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
bool bVert =
(eDict == FWLTHEME_DIRECTION_Up || eDict == FWLTHEME_DIRECTION_Down);
- FX_FLOAT fLeft =
- (FX_FLOAT)(((pRect->width - (bVert ? 9 : 6)) / 2 + pRect->left) + 0.5);
- FX_FLOAT fTop =
- (FX_FLOAT)(((pRect->height - (bVert ? 6 : 9)) / 2 + pRect->top) + 0.5);
+ float fLeft =
+ (float)(((pRect->width - (bVert ? 9 : 6)) / 2 + pRect->left) + 0.5);
+ float fTop =
+ (float)(((pRect->height - (bVert ? 6 : 9)) / 2 + pRect->top) + 0.5);
CFX_Path path;
switch (eDict) {
case FWLTHEME_DIRECTION_Down: {
@@ -240,8 +240,8 @@ void CFWL_WidgetTP::DrawBtn(CFX_Graphics* pGraphics,
CFX_Path path;
InitializeArrowColorData();
- FX_FLOAT fRight = pRect->right();
- FX_FLOAT fBottom = pRect->bottom();
+ float fRight = pRect->right();
+ float fBottom = pRect->bottom();
path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
DrawAxialShading(pGraphics, pRect->left, pRect->top, fRight, fBottom,
m_pColorData->clrStart[eState - 1],
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index c81950793a..730a39cd17 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -66,10 +66,10 @@ class CFWL_WidgetTP {
const CFX_RectF* pRect,
CFX_Matrix* pMatrix = nullptr);
void DrawAxialShading(CFX_Graphics* pGraphics,
- FX_FLOAT fx1,
- FX_FLOAT fy1,
- FX_FLOAT fx2,
- FX_FLOAT fy2,
+ float fx1,
+ float fy1,
+ float fx2,
+ float fy2,
FX_ARGB beginColor,
FX_ARGB endColor,
CFX_Path* path,