Remove unused integer fill flags and converter functions.
After integer fill flags being migrated to struct CFX_FillRenderOptions,
this CL removes the unused integer fill flags and the functions which
help convert between integer flags and struct CFX_FillRenderOptions.
Bug: pdfium:1531
Change-Id: Iccca5f6d5e9886083806fce03dcdbc138c3be9d7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/71533
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Hui Yingst <nigi@chromium.org>
diff --git a/core/fxge/cfx_fillrenderoptions.cpp b/core/fxge/cfx_fillrenderoptions.cpp
index 8cb67fd..111a433 100644
--- a/core/fxge/cfx_fillrenderoptions.cpp
+++ b/core/fxge/cfx_fillrenderoptions.cpp
@@ -5,7 +5,6 @@
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxcrt/fx_system.h"
-#include "core/fxge/render_defines.h"
#include "third_party/base/no_destructor.h"
// static
@@ -27,51 +26,3 @@
CFX_FillRenderOptions::CFX_FillRenderOptions(
CFX_FillRenderOptions::FillType fill_type)
: fill_type(fill_type) {}
-
-CFX_FillRenderOptions::FillType GetFillType(int fill_type) {
- ASSERT(fill_type >= 0);
- ASSERT(fill_type <= 2);
- return static_cast<CFX_FillRenderOptions::FillType>(fill_type);
-}
-
-CFX_FillRenderOptions GetFillOptionsFromIntegerFlags(int flags) {
- CFX_FillRenderOptions options(GetFillType(flags & 3));
- if (flags & FX_STROKE_ADJUST)
- options.adjust_stroke = true;
- if (flags & FXFILL_NOPATHSMOOTH)
- options.aliased_path = true;
- if (flags & FXFILL_FULLCOVER)
- options.full_cover = true;
- if (flags & FXFILL_RECT_AA)
- options.rect_aa = true;
- if (flags & FX_FILL_STROKE)
- options.stroke = true;
- if (flags & FX_STROKE_TEXT_MODE)
- options.stroke_text_mode = true;
- if (flags & FX_FILL_TEXT_MODE)
- options.text_mode = true;
- if (flags & FX_ZEROAREA_FILL)
- options.zero_area = true;
- return options;
-}
-
-int GetIntegerFlagsFromFillOptions(const CFX_FillRenderOptions& options) {
- int flags = static_cast<int>(options.fill_type);
- if (options.adjust_stroke)
- flags |= FX_STROKE_ADJUST;
- if (options.aliased_path)
- flags |= FXFILL_NOPATHSMOOTH;
- if (options.full_cover)
- flags |= FXFILL_FULLCOVER;
- if (options.rect_aa)
- flags |= FXFILL_RECT_AA;
- if (options.stroke)
- flags |= FX_FILL_STROKE;
- if (options.stroke_text_mode)
- flags |= FX_STROKE_TEXT_MODE;
- if (options.text_mode)
- flags |= FX_FILL_TEXT_MODE;
- if (options.zero_area)
- flags |= FX_ZEROAREA_FILL;
- return flags;
-}
diff --git a/core/fxge/cfx_fillrenderoptions.h b/core/fxge/cfx_fillrenderoptions.h
index 180f1a1..6969bd4 100644
--- a/core/fxge/cfx_fillrenderoptions.h
+++ b/core/fxge/cfx_fillrenderoptions.h
@@ -55,23 +55,4 @@
bool zero_area = false;
};
-// Converts integer |fill_type| into CFX_FillRenderOptions::FillType.
-// |fill_type| can be 0, FXFILL_ALTERNATE or FXFILL_WINDING.
-// TODO(https://crbug.com/pdfium/1531): Remove this function when all existence
-// of FXFILL_ALTERNATE and FXFILL_WINDING are replaced by FillType::kEvenOdd and
-// FillType::kWinding.
-CFX_FillRenderOptions::FillType GetFillType(int fill_type);
-
-// TODO(https://crbug.com/pdfium/1531): Remove the converter functions
-// GetFillOptionsFromIntegerFlags() and GetIntegerFlagsFromFillOptions() once
-// all integer rendering flags are replaced with CFX_FillRenderOptions.
-
-// Generates a matching CFX_FillRenderOptions struct from integer |flags| which
-// contains fill rendering options.
-CFX_FillRenderOptions GetFillOptionsFromIntegerFlags(int flags);
-
-// Generates an integer which represents fill options from CFX_FillRenderOptions
-// struct |options|.
-int GetIntegerFlagsFromFillOptions(const CFX_FillRenderOptions& options);
-
#endif // CORE_FXGE_CFX_FILLRENDEROPTIONS_H_
diff --git a/core/fxge/cfx_glyphcache.cpp b/core/fxge/cfx_glyphcache.cpp
index 57bb0d6..0e7e6b5 100644
--- a/core/fxge/cfx_glyphcache.cpp
+++ b/core/fxge/cfx_glyphcache.cpp
@@ -21,7 +21,6 @@
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_freetype.h"
-#include "core/fxge/render_defines.h"
#include "core/fxge/scoped_font_transform.h"
#include "third_party/base/numerics/safe_math.h"
diff --git a/core/fxge/render_defines.h b/core/fxge/render_defines.h
index 3321505..8eff198 100644
--- a/core/fxge/render_defines.h
+++ b/core/fxge/render_defines.h
@@ -28,15 +28,4 @@
#define FXRC_FILLSTROKE_PATH 0x2000
#define FXRC_SHADING 0x4000
-#define FXFILL_ALTERNATE 1
-#define FXFILL_WINDING 2
-#define FXFILL_FULLCOVER 4
-#define FXFILL_RECT_AA 8
-#define FX_FILL_STROKE 16
-#define FX_STROKE_ADJUST 32
-#define FX_STROKE_TEXT_MODE 64
-#define FX_FILL_TEXT_MODE 128
-#define FX_ZEROAREA_FILL 256
-#define FXFILL_NOPATHSMOOTH 512
-
#endif // CORE_FXGE_RENDER_DEFINES_H_