summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffwidget.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-08-17 13:53:52 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-17 21:22:30 +0000
commit7c9d4c272c57965cb1d407a156bab1110c65e0f6 (patch)
tree1f8cb5b5f21b5f0bdcde82caf3f9a8359477d985 /xfa/fxfa/cxfa_ffwidget.cpp
parentba1897b238b421e36cb34f223b8b24be2845d413 (diff)
downloadpdfium-7c9d4c272c57965cb1d407a156bab1110c65e0f6.tar.xz
Change CXFA_FFWidget::RenderWidget() to take a const CFX_Matrix&.
Change some related code to take a const CFX_Matrix* since it is not immediately obvious if the matrix can be made into a const-ref. Change-Id: I15c840222b575cc479b1f6f0b6d3b3c0e50d5515 Reviewed-on: https://pdfium-review.googlesource.com/11113 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidget.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 6996b647d3..ee445bbf25 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -391,7 +391,7 @@ void XFA_BOX_Fill_Radial(CXFA_Box box,
CXFA_Graphics* pGS,
CXFA_Path& fillPath,
CFX_RectF rtFill,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
CXFA_Fill fill = box.GetFill();
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
@@ -414,7 +414,7 @@ void XFA_BOX_Fill_Pattern(CXFA_Box box,
CXFA_Graphics* pGS,
CXFA_Path& fillPath,
CFX_RectF rtFill,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
CXFA_Fill fill = box.GetFill();
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
@@ -449,7 +449,7 @@ void XFA_BOX_Fill_Linear(CXFA_Box box,
CXFA_Graphics* pGS,
CXFA_Path& fillPath,
CFX_RectF rtFill,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
CXFA_Fill fill = box.GetFill();
FX_ARGB crStart = fill.GetColor();
FX_ARGB crEnd;
@@ -485,7 +485,7 @@ void XFA_BOX_Fill(CXFA_Box box,
const std::vector<CXFA_Stroke>& strokes,
CXFA_Graphics* pGS,
const CFX_RectF& rtWidget,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
uint32_t dwFlags) {
CXFA_Fill fill = box.GetFill();
if (!fill || fill.GetPresence() != XFA_ATTRIBUTEENUM_Visible)
@@ -530,7 +530,7 @@ void XFA_BOX_Fill(CXFA_Box box,
void XFA_BOX_StrokePath(CXFA_Stroke stroke,
CXFA_Path* pPath,
CXFA_Graphics* pGS,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
if (!stroke || !stroke.IsVisible()) {
return;
}
@@ -555,7 +555,7 @@ void XFA_BOX_StrokePath(CXFA_Stroke stroke,
void XFA_BOX_StrokeArc(CXFA_Box box,
CXFA_Graphics* pGS,
CFX_RectF rtWidget,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
uint32_t dwFlags) {
CXFA_Edge edge = box.GetEdge(0);
if (!edge || !edge.IsVisible()) {
@@ -641,7 +641,7 @@ void XFA_BOX_StrokeArc(CXFA_Box box,
void XFA_Draw3DRect(CXFA_Graphics* pGraphic,
const CFX_RectF& rt,
float fLineWidth,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
FX_ARGB argbTopLeft,
FX_ARGB argbBottomRight) {
float fBottom = rt.bottom();
@@ -672,7 +672,7 @@ void XFA_Draw3DRect(CXFA_Graphics* pGraphic,
void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS,
CFX_RectF rt,
float fThickness,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
float fHalfWidth = fThickness / 2.0f;
CFX_RectF rtInner(rt);
rtInner.Deflate(fHalfWidth, fHalfWidth);
@@ -688,7 +688,7 @@ void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS,
void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS,
CFX_RectF rt,
float fThickness,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
float fHalfWidth = fThickness / 2.0f;
CFX_RectF rtInner(rt);
rtInner.Deflate(fHalfWidth, fHalfWidth);
@@ -704,7 +704,7 @@ void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS,
void XFA_BOX_Stroke_3DRect_Etched(CXFA_Graphics* pGS,
CFX_RectF rt,
float fThickness,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
float fHalfWidth = fThickness / 2.0f;
XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFFFFFFFF);
CFX_RectF rtInner(rt);
@@ -715,7 +715,7 @@ void XFA_BOX_Stroke_3DRect_Etched(CXFA_Graphics* pGS,
void XFA_BOX_Stroke_3DRect_Embossed(CXFA_Graphics* pGS,
CFX_RectF rt,
float fThickness,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
float fHalfWidth = fThickness / 2.0f;
XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFF000000);
CFX_RectF rtInner(rt);
@@ -727,7 +727,7 @@ void XFA_BOX_Stroke_Rect(CXFA_Box box,
const std::vector<CXFA_Stroke>& strokes,
CXFA_Graphics* pGS,
CFX_RectF rtWidget,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
bool bVisible = false;
float fThickness = 0;
int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
@@ -816,7 +816,7 @@ void XFA_BOX_Stroke(CXFA_Box box,
const std::vector<CXFA_Stroke>& strokes,
CXFA_Graphics* pGS,
CFX_RectF rtWidget,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
uint32_t dwFlags) {
if (box.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) {
XFA_BOX_StrokeArc(box, pGS, rtWidget, pMatrix, dwFlags);
@@ -881,7 +881,7 @@ void XFA_BOX_Stroke(CXFA_Box box,
void XFA_DrawBox(CXFA_Box box,
CXFA_Graphics* pGS,
const CFX_RectF& rtWidget,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
uint32_t dwFlags) {
if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible)
return;
@@ -976,7 +976,7 @@ bool CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) {
}
void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix& matrix,
uint32_t dwStatus) {
if (!IsMatchVisibleStatus(dwStatus))
return;
@@ -991,7 +991,7 @@ void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS,
XFA_RectWidthoutMargin(rtBorder, margin);
rtBorder.Normalize();
- DrawBorder(pGS, border, rtBorder, pMatrix);
+ DrawBorder(pGS, border, rtBorder, &matrix);
}
bool CXFA_FFWidget::IsLoaded() {
@@ -1014,14 +1014,14 @@ void CXFA_FFWidget::UpdateWidgetProperty() {}
void CXFA_FFWidget::DrawBorder(CXFA_Graphics* pGS,
CXFA_Box box,
const CFX_RectF& rtBorder,
- CFX_Matrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
XFA_DrawBox(box, pGS, rtBorder, pMatrix, 0);
}
void CXFA_FFWidget::DrawBorderWithFlags(CXFA_Graphics* pGS,
CXFA_Box box,
const CFX_RectF& rtBorder,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
uint32_t dwFlags) {
XFA_DrawBox(box, pGS, rtBorder, pMatrix, dwFlags);
}
@@ -1683,7 +1683,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(
void XFA_DrawImage(CXFA_Graphics* pGS,
const CFX_RectF& rtImage,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix& matrix,
const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap,
int32_t iAspect,
int32_t iImageXDpi,
@@ -1738,12 +1738,12 @@ void XFA_DrawImage(CXFA_Graphics* pGS,
CFX_RenderDevice::StateRestorer restorer(pRenderDevice);
CFX_PathData path;
path.AppendRect(rtImage.left, rtImage.bottom(), rtImage.right(), rtImage.top);
- pRenderDevice->SetClip_PathFill(&path, pMatrix, FXFILL_WINDING);
+ pRenderDevice->SetClip_PathFill(&path, &matrix, FXFILL_WINDING);
CFX_Matrix mtImage(1, 0, 0, -1, 0, 1);
mtImage.Concat(
CFX_Matrix(rtFit.width, 0, 0, rtFit.height, rtFit.left, rtFit.top));
- mtImage.Concat(*pMatrix);
+ mtImage.Concat(matrix);
CXFA_ImageRenderer imageRender;
if (!imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage,