summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_renderdevice.cpp
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-08-18 14:04:56 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-21 14:50:36 +0000
commit2f7653c0d8fe60f1a4956382dcb3d73822694dda (patch)
tree5841475fc11d51c0787aed1e73b80e46805e967d /core/fxge/cfx_renderdevice.cpp
parent8b2107ed93465c6f9c1dd647e93446354dbe3738 (diff)
downloadpdfium-2f7653c0d8fe60f1a4956382dcb3d73822694dda.tar.xz
Converted DrawCosmeticLine() to take point objects
Converted CFX_RenderDevice::DrawCosmeticLine() and IFX_RenderDeviceDriver:: DrawCosmeticLine() to take in CFX_PointF objects instead of two coordinates per point. Bug=pdfium:769 Change-Id: I6116e4106a61487184a71e79c1dca3a85e8c7c27 Reviewed-on: https://pdfium-review.googlesource.com/11410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/cfx_renderdevice.cpp')
-rw-r--r--core/fxge/cfx_renderdevice.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index a7b1a93643..8f35dce2da 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -514,8 +514,7 @@ bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData,
pos1 = pObject2Device->Transform(pos1);
pos2 = pObject2Device->Transform(pos2);
}
- DrawCosmeticLine(pos1.x, pos1.y, pos2.x, pos2.y, fill_color, fill_mode,
- blend_type);
+ DrawCosmeticLine(pos1, pos2, fill_color, fill_mode, blend_type);
return true;
}
@@ -691,21 +690,19 @@ bool CFX_RenderDevice::FillRectWithBlend(const FX_RECT* pRect,
return true;
}
-bool CFX_RenderDevice::DrawCosmeticLine(float x1,
- float y1,
- float x2,
- float y2,
+bool CFX_RenderDevice::DrawCosmeticLine(const CFX_PointF& ptMoveTo,
+ const CFX_PointF& ptLineTo,
uint32_t color,
int fill_mode,
int blend_type) {
- if ((color >= 0xff000000) &&
- m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, blend_type)) {
+ if ((color >= 0xff000000) && m_pDeviceDriver->DrawCosmeticLine(
+ ptMoveTo, ptLineTo, color, blend_type)) {
return true;
}
CFX_GraphStateData graph_state;
CFX_PathData path;
- path.AppendPoint(CFX_PointF(x1, y1), FXPT_TYPE::MoveTo, false);
- path.AppendPoint(CFX_PointF(x2, y2), FXPT_TYPE::LineTo, false);
+ path.AppendPoint(ptMoveTo, FXPT_TYPE::MoveTo, false);
+ path.AppendPoint(ptLineTo, FXPT_TYPE::LineTo, false);
return m_pDeviceDriver->DrawPath(&path, nullptr, &graph_state, 0, color,
fill_mode, blend_type);
}