Revert recent C++20 usage in CFX_FillRenderOptions
This effectively reverts https://pdfium-review.googlesource.com/112930
and https://pdfium-review.googlesource.com/112934, to unblock some
embedders that are not ready for C++20 language features.
Bug: pdfium:1932
Change-Id: Ia313b9040e2efa0c84aad2a8b56e9ce968df5256
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/113291
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index 1efa7e9..a5a2652 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -483,7 +483,7 @@
ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha);
m_pRenderStatus->GetRenderDevice()->DrawPath(
path, nullptr, nullptr, fill_color, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ CFX_FillRenderOptions::WindingOptions());
return false;
}
RetainPtr<CFX_DIBBase> pAlphaMask;
diff --git a/core/fpdfapi/render/cpdf_rendershading.cpp b/core/fpdfapi/render/cpdf_rendershading.cpp
index cf1ed01..4991d76 100644
--- a/core/fpdfapi/render/cpdf_rendershading.cpp
+++ b/core/fpdfapi/render/cpdf_rendershading.cpp
@@ -710,11 +710,12 @@
D2.GetPoints(points.subspan(3, 4));
C2.GetPointsReverse(points.subspan(6, 4));
D1.GetPointsReverse(points.subspan(9, 4));
- const CFX_FillRenderOptions fill_options = {
- .fill_type = CFX_FillRenderOptions::FillType::kWinding,
- .aliased_path = bNoPathSmooth,
- .full_cover = true,
- };
+ CFX_FillRenderOptions fill_options(
+ CFX_FillRenderOptions::WindingOptions());
+ fill_options.full_cover = true;
+ if (bNoPathSmooth) {
+ fill_options.aliased_path = true;
+ }
pDevice->DrawPath(
path, nullptr, nullptr,
ArgbEncode(alpha, div_colors[0].comp[0], div_colors[0].comp[1],
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index d86c2f6..2da1ed2 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -83,16 +83,25 @@
CFX_FillRenderOptions::FillType fill_type,
bool is_stroke,
bool is_type3_char) {
- const bool rect_aa = (fill_type != CFX_FillRenderOptions::FillType::kNoFill &&
- options.bRectAA);
- return {
- .fill_type = fill_type,
- .adjust_stroke = path_obj->m_GeneralState.GetStrokeAdjust(),
- .aliased_path = options.bNoPathSmooth,
- .rect_aa = rect_aa,
- .stroke = is_stroke,
- .text_mode = is_type3_char,
- };
+ CFX_FillRenderOptions fill_options(fill_type);
+ if (fill_type != CFX_FillRenderOptions::FillType::kNoFill &&
+ options.bRectAA) {
+ fill_options.rect_aa = true;
+ }
+ if (options.bNoPathSmooth) {
+ fill_options.aliased_path = true;
+ }
+ if (path_obj->m_GeneralState.GetStrokeAdjust()) {
+ fill_options.adjust_stroke = true;
+ }
+ if (is_stroke) {
+ fill_options.stroke = true;
+ }
+ if (is_type3_char) {
+ fill_options.text_mode = true;
+ }
+
+ return fill_options;
}
CFX_FillRenderOptions GetFillOptionsForDrawTextPath(
@@ -100,12 +109,19 @@
const CPDF_TextObject* text_obj,
bool is_stroke,
bool is_fill) {
- return {
- .adjust_stroke = text_obj->m_GeneralState.GetStrokeAdjust(),
- .aliased_path = options.bNoTextSmooth,
- .stroke = (is_stroke && is_fill),
- .stroke_text_mode = (is_stroke && is_fill),
- };
+ CFX_FillRenderOptions fill_options;
+ if (is_stroke && is_fill) {
+ fill_options.stroke = true;
+ fill_options.stroke_text_mode = true;
+ }
+ if (text_obj->m_GeneralState.GetStrokeAdjust()) {
+ fill_options.adjust_stroke = true;
+ }
+ if (options.bNoTextSmooth) {
+ fill_options.aliased_path = true;
+ }
+
+ return fill_options;
}
FXDIB_Format GetFormatForLuminosity(bool is_luminosity) {
@@ -485,9 +501,8 @@
if (pPath->GetPoints().empty()) {
CFX_Path empty_path;
empty_path.AppendRect(-1, -1, 0, 0);
- m_pDevice->SetClip_PathFill(
- empty_path, nullptr,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ m_pDevice->SetClip_PathFill(empty_path, nullptr,
+ CFX_FillRenderOptions::WindingOptions());
} else {
m_pDevice->SetClip_PathFill(
*pPath, &mtObj2Device,
@@ -512,13 +527,14 @@
ProcessText(pText, mtObj2Device, pTextClippingPath.get());
continue;
}
+
if (!pTextClippingPath)
continue;
- const CFX_FillRenderOptions fill_options = {
- .fill_type = CFX_FillRenderOptions::FillType::kWinding,
- .aliased_path = m_Options.GetOptions().bNoTextSmooth,
- };
+ CFX_FillRenderOptions fill_options(CFX_FillRenderOptions::WindingOptions());
+ if (m_Options.GetOptions().bNoTextSmooth) {
+ fill_options.aliased_path = true;
+ }
m_pDevice->SetClip_PathFill(*pTextClippingPath, nullptr, fill_options);
pTextClippingPath.reset();
}
@@ -545,10 +561,10 @@
&path_matrix,
path_obj->m_GraphState.GetObject());
}
- const CFX_FillRenderOptions fill_options = {
- .fill_type = path_obj->filltype(),
- .aliased_path = m_Options.GetOptions().bNoPathSmooth,
- };
+ CFX_FillRenderOptions fill_options(path_obj->filltype());
+ if (m_Options.GetOptions().bNoPathSmooth) {
+ fill_options.aliased_path = true;
+ }
return m_pDevice->SetClip_PathFill(*path_obj->path().GetObject(),
&path_matrix, fill_options);
}
diff --git a/core/fxge/cfx_defaultrenderdevice_unittest.cpp b/core/fxge/cfx_defaultrenderdevice_unittest.cpp
index 11ed6db..9304a8c 100644
--- a/core/fxge/cfx_defaultrenderdevice_unittest.cpp
+++ b/core/fxge/cfx_defaultrenderdevice_unittest.cpp
@@ -25,15 +25,17 @@
// Matrix that transposes and translates by 1 unit on each axis.
const CFX_Matrix object_to_device(0, 1, 1, 0, 1, -1);
+ // Fill type cannot be none.
+ const CFX_FillRenderOptions fill_options(
+ CFX_FillRenderOptions::FillType::kEvenOdd);
+
CFX_DefaultRenderDevice device;
ASSERT_TRUE(device.Create(/*width=*/16, /*height=*/16, FXDIB_Format::kArgb,
/*pBackdropBitmap=*/nullptr));
CFX_Path path;
path.AppendRect(2, 4, 14, 12);
- EXPECT_TRUE(device.SetClip_PathFill(
- path, &object_to_device,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd}));
+ EXPECT_TRUE(device.SetClip_PathFill(path, &object_to_device, fill_options));
EXPECT_EQ(FX_RECT(5, 1, 13, 13), device.GetClipBox());
}
diff --git a/core/fxge/cfx_drawutils.cpp b/core/fxge/cfx_drawutils.cpp
index 44d0db1..3591471 100644
--- a/core/fxge/cfx_drawutils.cpp
+++ b/core/fxge/cfx_drawutils.cpp
@@ -35,7 +35,7 @@
graph_state_data.m_DashPhase = 0;
graph_state_data.m_LineWidth = 1.0f;
- render_device->DrawPath(
- path, &user_to_device, &graph_state_data, 0, ArgbEncode(255, 0, 0, 0),
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ render_device->DrawPath(path, &user_to_device, &graph_state_data, 0,
+ ArgbEncode(255, 0, 0, 0),
+ CFX_FillRenderOptions::EvenOddOptions());
}
diff --git a/core/fxge/cfx_fillrenderoptions.h b/core/fxge/cfx_fillrenderoptions.h
index 3c0a1ae..d123f72 100644
--- a/core/fxge/cfx_fillrenderoptions.h
+++ b/core/fxge/cfx_fillrenderoptions.h
@@ -23,6 +23,29 @@
kWinding = 2,
};
+ static constexpr CFX_FillRenderOptions EvenOddOptions() {
+ return CFX_FillRenderOptions(FillType::kEvenOdd);
+ }
+ static constexpr CFX_FillRenderOptions WindingOptions() {
+ return CFX_FillRenderOptions(FillType::kWinding);
+ }
+
+ constexpr CFX_FillRenderOptions()
+ : CFX_FillRenderOptions(FillType::kNoFill) {}
+
+ // TODO(thestig): Switch to default member initializer for bit-fields when
+ // C++20 is available.
+ constexpr explicit CFX_FillRenderOptions(FillType fill_type)
+ : fill_type(fill_type),
+ adjust_stroke(false),
+ aliased_path(false),
+ full_cover(false),
+ rect_aa(false),
+ stroke(false),
+ stroke_text_mode(false),
+ text_mode(false),
+ zero_area(false) {}
+
bool operator==(const CFX_FillRenderOptions& other) const {
return fill_type == other.fill_type &&
adjust_stroke == other.adjust_stroke &&
@@ -38,31 +61,31 @@
}
// Fill type.
- FillType fill_type = FillType::kNoFill;
+ FillType fill_type;
// Adjusted stroke rendering is enabled.
- bool adjust_stroke : 1 = false;
+ bool adjust_stroke : 1;
// Whether anti aliasing is enabled for path rendering.
- bool aliased_path : 1 = false;
+ bool aliased_path : 1;
// Fills with the sum of colors from both cover and source.
- bool full_cover : 1 = false;
+ bool full_cover : 1;
// Rect paths use anti-aliasing.
- bool rect_aa : 1 = false;
+ bool rect_aa : 1;
// Path is stroke.
- bool stroke : 1 = false;
+ bool stroke : 1;
// Renders text by filling strokes.
- bool stroke_text_mode : 1 = false;
+ bool stroke_text_mode : 1;
// Path is text.
- bool text_mode : 1 = false;
+ bool text_mode : 1;
// Path encloses zero area.
- bool zero_area : 1 = false;
+ bool zero_area : 1;
};
#endif // CORE_FXGE_CFX_FILLRENDEROPTIONS_H_
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 0d5497f..ca2b08b 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -578,11 +578,11 @@
bool CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) {
CFX_Path path;
path.AppendRect(rect.left, rect.bottom, rect.right, rect.top);
- if (!SetClip_PathFill(
- path, nullptr,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding})) {
+ if (!SetClip_PathFill(path, nullptr,
+ CFX_FillRenderOptions::WindingOptions())) {
return false;
}
+
UpdateClipBox();
return true;
}
@@ -865,10 +865,10 @@
if (matrix && !matrix->IsIdentity() && !set_identity)
new_matrix = matrix;
- const CFX_FillRenderOptions path_options = {
- .aliased_path = aliased_path,
- .zero_area = true,
- };
+ CFX_FillRenderOptions path_options;
+ path_options.zero_area = true;
+ path_options.aliased_path = aliased_path;
+
m_pDeviceDriver->DrawPath(new_path, new_matrix, &graph_state, 0, stroke_color,
path_options, blend_type);
}
@@ -1081,9 +1081,8 @@
if (fabs(char2device.a) + fabs(char2device.b) > 50 * 1.0f ||
GetDeviceType() == DeviceType::kPrinter) {
if (pFont->GetFaceRec()) {
- const CFX_FillRenderOptions path_options = {
- .aliased_path = !is_text_smooth,
- };
+ CFX_FillRenderOptions path_options;
+ path_options.aliased_path = !is_text_smooth;
return DrawTextPath(pCharPos, pFont, font_size, mtText2Device, nullptr,
nullptr, fill_color, 0, nullptr, path_options);
}
@@ -1224,13 +1223,11 @@
CFX_Path transformed_path(*pPath);
transformed_path.Transform(matrix);
if (fill_color || stroke_color) {
- const CFX_FillRenderOptions::FillType fill_type =
- fill_color ? CFX_FillRenderOptions::FillType::kWinding
- : CFX_FillRenderOptions::FillType::kNoFill;
- const CFX_FillRenderOptions options = {
- .fill_type = fill_type,
- .text_mode = true,
- };
+ CFX_FillRenderOptions options(fill_options);
+ if (fill_color) {
+ options.fill_type = CFX_FillRenderOptions::FillType::kWinding;
+ }
+ options.text_mode = true;
if (!DrawPathWithBlend(transformed_path, pUser2Device, pGraphState,
fill_color, stroke_color, options,
BlendMode::kNormal)) {
@@ -1249,7 +1246,7 @@
CFX_Path path;
path.AppendFloatRect(rect);
DrawPath(path, pUser2Device, nullptr, color, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ CFX_FillRenderOptions::WindingOptions());
}
void CFX_RenderDevice::DrawFillArea(const CFX_Matrix& mtUser2Device,
@@ -1262,7 +1259,7 @@
path.AppendPoint(points[i], CFX_Path::Point::Type::kLine);
DrawPath(path, &mtUser2Device, nullptr, color, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
}
void CFX_RenderDevice::DrawStrokeRect(const CFX_Matrix& mtUser2Device,
@@ -1275,7 +1272,7 @@
CFX_Path path;
path.AppendFloatRect(rect);
DrawPath(path, &mtUser2Device, &gsd, 0, color,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
}
void CFX_RenderDevice::DrawStrokeLine(const CFX_Matrix* pUser2Device,
@@ -1291,7 +1288,7 @@
gsd.m_LineWidth = fWidth;
DrawPath(path, pUser2Device, &gsd, 0, color,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
}
void CFX_RenderDevice::DrawFillRect(const CFX_Matrix* pUser2Device,
@@ -1357,7 +1354,7 @@
path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth,
fTop - fWidth);
DrawPath(path, pUser2Device, nullptr, color.ToFXColor(nTransparency), 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
break;
}
case BorderStyle::kDash: {
@@ -1378,7 +1375,7 @@
path.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fBottom + fHalfWidth),
CFX_Path::Point::Type::kLine);
DrawPath(path, pUser2Device, &gsd, 0, color.ToFXColor(nTransparency),
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ CFX_FillRenderOptions::WindingOptions());
break;
}
case BorderStyle::kBeveled:
@@ -1407,7 +1404,7 @@
CFX_Path::Point::Type::kLine);
DrawPath(path_left_top, pUser2Device, &gsd,
crLeftTop.ToFXColor(nTransparency), 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
CFX_Path path_right_bottom;
path_right_bottom.AppendPoint(
@@ -1432,14 +1429,14 @@
CFX_Path::Point::Type::kLine);
DrawPath(path_right_bottom, pUser2Device, &gsd,
crRightBottom.ToFXColor(nTransparency), 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
CFX_Path path;
path.AppendRect(fLeft, fBottom, fRight, fTop);
path.AppendRect(fLeft + fHalfWidth, fBottom + fHalfWidth,
fRight - fHalfWidth, fTop - fHalfWidth);
DrawPath(path, pUser2Device, &gsd, color.ToFXColor(nTransparency), 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
break;
}
case BorderStyle::kUnderline: {
@@ -1452,7 +1449,7 @@
path.AppendPoint(CFX_PointF(fRight, fBottom + fHalfWidth),
CFX_Path::Point::Type::kLine);
DrawPath(path, pUser2Device, &gsd, 0, color.ToFXColor(nTransparency),
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
break;
}
}
diff --git a/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp b/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp
index 6c4063e..b637b46 100644
--- a/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp
+++ b/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp
@@ -57,8 +57,7 @@
path_data.AppendLine(p3, p1);
path_data.ClosePath();
EXPECT_TRUE(m_driver->SetClip_PathFill(
- path_data, &kIdentityMatrix,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding}));
+ path_data, &kIdentityMatrix, CFX_FillRenderOptions::WindingOptions()));
}
TEST_F(CFX_WindowsRenderDeviceTest, SimpleClipRect) {
@@ -67,8 +66,7 @@
path_data.AppendRect(0.0f, 100.0f, 200.0f, 0.0f);
path_data.ClosePath();
EXPECT_TRUE(m_driver->SetClip_PathFill(
- path_data, &kIdentityMatrix,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding}));
+ path_data, &kIdentityMatrix, CFX_FillRenderOptions::WindingOptions()));
}
TEST_F(CFX_WindowsRenderDeviceTest, GargantuanClipRect) {
@@ -82,8 +80,7 @@
// however they do not because the GDI API IntersectClipRect() errors out and
// affect subsequent imaging. crbug.com/1019026
EXPECT_FALSE(m_driver->SetClip_PathFill(
- path_data, &kIdentityMatrix,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding}));
+ path_data, &kIdentityMatrix, CFX_FillRenderOptions::WindingOptions()));
}
TEST_F(CFX_WindowsRenderDeviceTest, GargantuanClipRectWithBaseClip) {
@@ -97,6 +94,5 @@
// Use of a reasonable base clip ensures that we avoid getting an error back
// from GDI API IntersectClipRect().
EXPECT_TRUE(m_driver->SetClip_PathFill(
- path_data, &kIdentityMatrix,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding}));
+ path_data, &kIdentityMatrix, CFX_FillRenderOptions::WindingOptions()));
}
diff --git a/core/fxge/skia/fx_skia_device_embeddertest.cpp b/core/fxge/skia/fx_skia_device_embeddertest.cpp
index 5aa9a76..d904230 100644
--- a/core/fxge/skia/fx_skia_device_embeddertest.cpp
+++ b/core/fxge/skia/fx_skia_device_embeddertest.cpp
@@ -92,7 +92,7 @@
driver->SetClip_PathFill(clipPath, &clipMatrix, CFX_FillRenderOptions());
if (state.m_graphic == State::Graphic::kPath) {
driver->DrawPath(path1, &matrix, &graphState, 0xFF112233, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding},
+ CFX_FillRenderOptions::WindingOptions(),
BlendMode::kNormal);
} else if (state.m_graphic == State::Graphic::kText) {
driver->DrawDeviceText(charPos, &font, matrix, fontSize, 0xFF445566,
@@ -116,7 +116,7 @@
driver->SetClip_PathFill(clipPath, &clipMatrix2, CFX_FillRenderOptions());
if (state.m_graphic == State::Graphic::kPath) {
driver->DrawPath(path2, &matrix2, &graphState, 0xFF112233, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding},
+ CFX_FillRenderOptions::WindingOptions(),
BlendMode::kNormal);
} else if (state.m_graphic == State::Graphic::kText) {
driver->DrawDeviceText(charPos, &font, matrix2, fontSize, 0xFF445566,
diff --git a/core/fxge/win32/cps_printer_driver.cpp b/core/fxge/win32/cps_printer_driver.cpp
index b687945..f30b80d 100644
--- a/core/fxge/win32/cps_printer_driver.cpp
+++ b/core/fxge/win32/cps_printer_driver.cpp
@@ -81,9 +81,8 @@
static_cast<float>(pRect->right),
static_cast<float>(pRect->top));
}
- m_PSRenderer.SetClip_PathFill(
- path, nullptr,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ m_PSRenderer.SetClip_PathFill(path, nullptr,
+ CFX_FillRenderOptions::WindingOptions());
}
}
}
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 331bc51..162502c 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -923,7 +923,7 @@
CFX_Path path;
path.AppendFloatRect(GetRect());
pDevice->DrawPath(path, &mtUser2Device, &gsd, 0, 0xFFAAAAAA,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
} else {
CPDFSDK_BAAnnot::DrawAppearance(pDevice, mtUser2Device, mode);
}
diff --git a/fpdfsdk/pwl/cpwl_caret.cpp b/fpdfsdk/pwl/cpwl_caret.cpp
index 2507f4b..47f7864 100644
--- a/fpdfsdk/pwl/cpwl_caret.cpp
+++ b/fpdfsdk/pwl/cpwl_caret.cpp
@@ -50,7 +50,7 @@
CFX_GraphStateData gsd;
gsd.m_LineWidth = m_fWidth;
pDevice->DrawPath(path, &mtUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0),
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
}
void CPWL_Caret::OnTimerFired() {
diff --git a/fpdfsdk/pwl/cpwl_cbbutton.cpp b/fpdfsdk/pwl/cpwl_cbbutton.cpp
index 0cec527..de248ce 100644
--- a/fpdfsdk/pwl/cpwl_cbbutton.cpp
+++ b/fpdfsdk/pwl/cpwl_cbbutton.cpp
@@ -55,7 +55,7 @@
pDevice->DrawPath(path, &mtUser2Device, nullptr,
kDefaultBlackColor.ToFXColor(GetTransparency()), 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ CFX_FillRenderOptions::EvenOddOptions());
}
bool CPWL_CBButton::OnLButtonDown(Mask<FWL_EVENTFLAG> nFlag,
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index c4b0270..3657b88 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -199,9 +199,9 @@
path.AppendPoint(top, CFX_Path::Point::Type::kLine);
}
if (!path.GetPoints().empty()) {
- pDevice->DrawPath(
- path, &mtUser2Device, &gsd, 0, GetBorderColor().ToFXColor(255),
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ pDevice->DrawPath(path, &mtUser2Device, &gsd, 0,
+ GetBorderColor().ToFXColor(255),
+ CFX_FillRenderOptions::EvenOddOptions());
}
}
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 30b78ef..ba4f43d 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -642,9 +642,8 @@
word.ptWord.x + word.fWidth,
line.ptLine.y + line.fLineAscent);
- pDevice->DrawPath(
- pathSelBK, &mtUser2Device, nullptr, crSelBK, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ pDevice->DrawPath(pathSelBK, &mtUser2Device, nullptr, crSelBK, 0,
+ CFX_FillRenderOptions::WindingOptions());
}
}
if (bContinuous) {
diff --git a/fxbarcode/BC_TwoDimWriter.cpp b/fxbarcode/BC_TwoDimWriter.cpp
index 708699a..56be5ce 100644
--- a/fxbarcode/BC_TwoDimWriter.cpp
+++ b/fxbarcode/BC_TwoDimWriter.cpp
@@ -89,8 +89,7 @@
CFX_Path path;
path.AppendRect(0, 0, m_Width, m_Height);
device->DrawPath(path, &matrix, &stateData, kBackgroundColor,
- kBackgroundColor,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ kBackgroundColor, CFX_FillRenderOptions::EvenOddOptions());
int32_t leftPos = m_leftPadding;
int32_t topPos = m_topPadding;
@@ -119,9 +118,8 @@
topPos + start_y_output * m_multiY,
leftPos + end_x_output * m_multiX,
topPos + end_y_output * m_multiY);
- device->DrawPath(
- rect, &matri, &data, kBarColor, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ device->DrawPath(rect, &matri, &data, kBarColor, 0,
+ CFX_FillRenderOptions::WindingOptions());
}
}
}
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index 7c2604a..3320c47 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -237,15 +237,14 @@
path.AppendRect(0, 0, static_cast<float>(m_Width),
static_cast<float>(m_Height));
device->DrawPath(path, &matrix, &stateData, kBackgroundColor,
- kBackgroundColor,
- {.fill_type = CFX_FillRenderOptions::FillType::kEvenOdd});
+ kBackgroundColor, CFX_FillRenderOptions::EvenOddOptions());
CFX_Matrix scaledMatrix(m_outputHScale, 0.0, 0.0,
static_cast<float>(m_Height), 0.0, 0.0);
scaledMatrix.Concat(matrix);
for (const auto& rect : m_output) {
CFX_GraphStateData data;
device->DrawPath(rect, &scaledMatrix, &data, kBarColor, 0,
- {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ CFX_FillRenderOptions::WindingOptions());
}
return m_locTextLoc == BC_TEXT_LOC::kNone || !contents.Contains(' ') ||
diff --git a/xfa/fgas/graphics/cfgas_gegraphics.cpp b/xfa/fgas/graphics/cfgas_gegraphics.cpp
index ecac51a..6f255d6 100644
--- a/xfa/fgas/graphics/cfgas_gegraphics.cpp
+++ b/xfa/fgas/graphics/cfgas_gegraphics.cpp
@@ -221,7 +221,7 @@
CFX_Matrix m = m_info.CTM;
m.Concat(matrix);
- const CFX_FillRenderOptions fill_options = {.fill_type = fill_type};
+ const CFX_FillRenderOptions fill_options(fill_type);
switch (m_info.fillColor.GetType()) {
case CFGAS_GEColor::Solid:
m_renderDevice->DrawPath(path.GetPath(), &m, &m_info.graphState,
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 0a456dd..74b1cb2 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -120,8 +120,8 @@
CFX_RenderDevice::StateRestorer restorer(pRenderDevice);
CFX_Path path;
path.AppendRect(rtImage.left, rtImage.bottom(), rtImage.right(), rtImage.top);
- pRenderDevice->SetClip_PathFill(
- path, &matrix, {.fill_type = CFX_FillRenderOptions::FillType::kWinding});
+ pRenderDevice->SetClip_PathFill(path, &matrix,
+ CFX_FillRenderOptions::WindingOptions());
CFX_Matrix mtImage(1, 0, 0, -1, 0, 1);
mtImage.Concat(