summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme/cfwl_checkboxtp.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-08-16 15:09:00 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-16 22:54:39 +0000
commit574015e0ad53c592fe8a923390b31edeb30c41fe (patch)
treea3774207ebb4c1fc5b5abfb90a32adf974f76a10 /xfa/fwl/theme/cfwl_checkboxtp.cpp
parenta364729be3725adbc9689c1c8c23902df102243b (diff)
downloadpdfium-574015e0ad53c592fe8a923390b31edeb30c41fe.tar.xz
Tidy CXFA_Color class and argument passing.
Remove friendship. De-virtualize. Nest enum inside class. Make copy-assignable and pass by const ref. Make pack better on 64-bits. Change-Id: I1ae3b6d03756fa5780e9023795db6648e8b8299a Reviewed-on: https://pdfium-review.googlesource.com/11290 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fwl/theme/cfwl_checkboxtp.cpp')
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 334c1912a3..e783098347 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -64,12 +64,10 @@ void CFWL_CheckBoxTP::DrawSignCheck(CXFA_Graphics* pGraphics,
InitCheckPath(pRtSign->width);
CFX_Matrix mt;
- mt.SetIdentity();
mt.Translate(pRtSign->left, pRtSign->top);
mt.Concat(*pMatrix);
- CXFA_Color crFill(argbFill);
pGraphics->SaveGraphState();
- pGraphics->SetFillColor(&crFill);
+ pGraphics->SetFillColor(CXFA_Color(argbFill));
pGraphics->FillPath(m_pCheckPath.get(), FXFILL_WINDING, &mt);
pGraphics->RestoreGraphState();
}
@@ -80,9 +78,8 @@ void CFWL_CheckBoxTP::DrawSignCircle(CXFA_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
CXFA_Path path;
path.AddEllipse(*pRtSign);
- CXFA_Color crFill(argbFill);
pGraphics->SaveGraphState();
- pGraphics->SetFillColor(&crFill);
+ pGraphics->SetFillColor(CXFA_Color(argbFill));
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
pGraphics->RestoreGraphState();
}
@@ -98,9 +95,8 @@ void CFWL_CheckBoxTP::DrawSignCross(CXFA_Graphics* pGraphics,
path.AddLine(CFX_PointF(pRtSign->left, fBottom),
CFX_PointF(fRight, pRtSign->top));
- CXFA_Color crFill(argbFill);
pGraphics->SaveGraphState();
- pGraphics->SetStrokeColor(&crFill);
+ pGraphics->SetStrokeColor(CXFA_Color(argbFill));
pGraphics->SetLineWidth(1.0f);
pGraphics->StrokePath(&path, pMatrix);
pGraphics->RestoreGraphState();
@@ -120,9 +116,8 @@ void CFWL_CheckBoxTP::DrawSignDiamond(CXFA_Graphics* pGraphics,
path.LineTo(CFX_PointF(pRtSign->right(), pRtSign->top + fHeight / 2));
path.LineTo(CFX_PointF(pRtSign->left + fWidth / 2, pRtSign->top));
- CXFA_Color crFill(argbFill);
pGraphics->SaveGraphState();
- pGraphics->SetFillColor(&crFill);
+ pGraphics->SetFillColor(CXFA_Color(argbFill));
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
pGraphics->RestoreGraphState();
}
@@ -134,9 +129,8 @@ void CFWL_CheckBoxTP::DrawSignSquare(CXFA_Graphics* pGraphics,
CXFA_Path path;
path.AddRectangle(pRtSign->left, pRtSign->top, pRtSign->width,
pRtSign->height);
- CXFA_Color crFill(argbFill);
pGraphics->SaveGraphState();
- pGraphics->SetFillColor(&crFill);
+ pGraphics->SetFillColor(CXFA_Color(argbFill));
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
pGraphics->RestoreGraphState();
}
@@ -170,10 +164,8 @@ void CFWL_CheckBoxTP::DrawSignStar(CXFA_Graphics* pGraphics,
path.LineTo(points[nNext]);
}
-
- CXFA_Color crFill(argbFill);
pGraphics->SaveGraphState();
- pGraphics->SetFillColor(&crFill);
+ pGraphics->SetFillColor(CXFA_Color(argbFill));
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
pGraphics->RestoreGraphState();
}