summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffwidget.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-17 08:59:42 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-03-17 08:59:42 -0400
commit811b8a4f4482bb5c11ac7610e70a4c8fd34c2907 (patch)
treecafa17bad705518693c0a2ba9d8df9d50af2101e /xfa/fxfa/app/xfa_ffwidget.cpp
parenta03c343b47938fcb1b562741ff05252b01a4e39d (diff)
downloadpdfium-811b8a4f4482bb5c11ac7610e70a4c8fd34c2907.tar.xz
Move xfa/include/fxgraphics/fx_graphics.h to xfa/fxgraphics.
This Cl moves and splits apart the fx_graphics.h file into individual classes. The .cpp files are renamed to match the .h files. pre.h was removed at the same time and its contents moved to the correct places as needed. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1810563002 .
Diffstat (limited to 'xfa/fxfa/app/xfa_ffwidget.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffwidget.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
index 450c4ed6a0..93c1a3e349 100644
--- a/xfa/fxfa/app/xfa_ffwidget.cpp
+++ b/xfa/fxfa/app/xfa_ffwidget.cpp
@@ -15,7 +15,11 @@
#include "xfa/fxfa/app/xfa_ffdocview.h"
#include "xfa/fxfa/app/xfa_ffpageview.h"
#include "xfa/fxfa/app/xfa_textlayout.h"
-#include "xfa/include/fxgraphics/fx_graphics.h"
+#include "xfa/fxgraphics/cfx_color.h"
+#include "xfa/fxgraphics/cfx_path.h"
+#include "xfa/fxgraphics/cfx_pattern.h"
+#include "xfa/fxgraphics/cfx_shading.h"
+#include "xfa/fxgraphics/include/cfx_graphics.h"
CXFA_FFWidget::CXFA_FFWidget(CXFA_FFPageView* pPageView,
CXFA_WidgetAcc* pDataAcc)
@@ -1456,17 +1460,16 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box,
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
int32_t iType = fill.GetRadial(crEnd);
- CFX_Shading shading;
if (iType != XFA_ATTRIBUTEENUM_ToEdge) {
FX_ARGB temp = crEnd;
crEnd = crStart;
crStart = temp;
}
- shading.CreateRadial(rtFill.Center(), rtFill.Center(), 0,
- FXSYS_sqrt(rtFill.Width() * rtFill.Width() +
- rtFill.Height() * rtFill.Height()) /
- 2,
- TRUE, TRUE, crStart, crEnd);
+ CFX_Shading shading(rtFill.Center(), rtFill.Center(), 0,
+ FXSYS_sqrt(rtFill.Width() * rtFill.Width() +
+ rtFill.Height() * rtFill.Height()) /
+ 2,
+ TRUE, TRUE, crStart, crEnd);
CFX_Color cr(&shading);
pGS->SetFillColor(&cr);
pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix);
@@ -1480,7 +1483,7 @@ static void XFA_BOX_Fill_Pattern(CXFA_Box box,
FX_ARGB crStart, crEnd;
crStart = fill.GetColor();
int32_t iType = fill.GetPattern(crEnd);
- int32_t iHatch = FX_HATCHSTYLE_Cross;
+ FX_HatchStyle iHatch = FX_HATCHSTYLE_Cross;
switch (iType) {
case XFA_ATTRIBUTEENUM_CrossDiagonal:
iHatch = FX_HATCHSTYLE_DiagonalCross;
@@ -1500,8 +1503,8 @@ static void XFA_BOX_Fill_Pattern(CXFA_Box box,
default:
break;
}
- CFX_Pattern pattern;
- pattern.Create(iHatch, crEnd, crStart);
+
+ CFX_Pattern pattern(iHatch, crEnd, crStart);
CFX_Color cr(&pattern);
pGS->SetFillColor(&cr);
pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix);
@@ -1537,8 +1540,7 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box,
default:
break;
}
- CFX_Shading shading;
- shading.CreateAxial(ptStart, ptEnd, FALSE, FALSE, crStart, crEnd);
+ CFX_Shading shading(ptStart, ptEnd, FALSE, FALSE, crStart, crEnd);
CFX_Color cr(&shading);
pGS->SetFillColor(&cr);
pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix);