Use default member initializers in CFX_FillRenderOptions
Now that C++20 is available, this now works. Use this as a small test
to see if anything breaks with the switch to C++20.
Bug: pdfium:1932
Change-Id: I9862c6e784f458ff950d3592ffacb4d0a24f7a85
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/112930
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxge/cfx_fillrenderoptions.h b/core/fxge/cfx_fillrenderoptions.h
index d123f72..e198d83 100644
--- a/core/fxge/cfx_fillrenderoptions.h
+++ b/core/fxge/cfx_fillrenderoptions.h
@@ -33,18 +33,8 @@
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) {}
+ : fill_type(fill_type) {}
bool operator==(const CFX_FillRenderOptions& other) const {
return fill_type == other.fill_type &&
@@ -64,28 +54,28 @@
FillType fill_type;
// Adjusted stroke rendering is enabled.
- bool adjust_stroke : 1;
+ bool adjust_stroke : 1 = false;
// Whether anti aliasing is enabled for path rendering.
- bool aliased_path : 1;
+ bool aliased_path : 1 = false;
// Fills with the sum of colors from both cover and source.
- bool full_cover : 1;
+ bool full_cover : 1 = false;
// Rect paths use anti-aliasing.
- bool rect_aa : 1;
+ bool rect_aa : 1 = false;
// Path is stroke.
- bool stroke : 1;
+ bool stroke : 1 = false;
// Renders text by filling strokes.
- bool stroke_text_mode : 1;
+ bool stroke_text_mode : 1 = false;
// Path is text.
- bool text_mode : 1;
+ bool text_mode : 1 = false;
// Path encloses zero area.
- bool zero_area : 1;
+ bool zero_area : 1 = false;
};
#endif // CORE_FXGE_CFX_FILLRENDEROPTIONS_H_