diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-05-30 13:30:10 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-30 13:30:10 +0000 |
commit | 491112b06c802de0d7dc577e77690d1a081f05c9 (patch) | |
tree | 2a7b059c49cf52d31a82e3375d0761ea01c41ddc /fpdfsdk/fpdf_editpath.cpp | |
parent | 16ccc8b65747c265255a487e3e748ac9e2c1a701 (diff) | |
download | pdfium-491112b06c802de0d7dc577e77690d1a081f05c9.tar.xz |
Add FPDFPath_GetDrawMode() API
It was already possible to set the draw mode of a path object, this is
the other direction.
Change-Id: Id0ee98dd8dfe433edd0e4715fc009ad4d1625981
Reviewed-on: https://pdfium-review.googlesource.com/33010
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_editpath.cpp')
-rw-r--r-- | fpdfsdk/fpdf_editpath.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_editpath.cpp b/fpdfsdk/fpdf_editpath.cpp index a5873ef67d..7f00b85d7b 100644 --- a/fpdfsdk/fpdf_editpath.cpp +++ b/fpdfsdk/fpdf_editpath.cpp @@ -218,6 +218,24 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, return true; } +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetDrawMode(FPDF_PAGEOBJECT path, + int* fillmode, + FPDF_BOOL* stroke) { + auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path); + if (!pPathObj || !fillmode || !stroke) + return false; + + if (pPathObj->m_FillType == FXFILL_ALTERNATE) + *fillmode = FPDF_FILLMODE_ALTERNATE; + else if (pPathObj->m_FillType == FXFILL_WINDING) + *fillmode = FPDF_FILLMODE_WINDING; + else + *fillmode = FPDF_FILLMODE_NONE; + + *stroke = pPathObj->m_bStroke; + return true; +} + FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path, int line_join) { auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path); |