Rename CFX_PathData to CFX_Path.
Shorten the name. Do the same for CFX_RetainablePath, method names, and
variable names.
Change-Id: I4129c840e96a2fc97e10b104f850a7c28402e9ac
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/81987
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_path.cpp b/core/fpdfapi/page/cpdf_path.cpp
index bb41699..a0e1c90 100644
--- a/core/fpdfapi/page/cpdf_path.cpp
+++ b/core/fpdfapi/page/cpdf_path.cpp
@@ -42,8 +42,8 @@
m_Ref.GetPrivateCopy()->Transform(matrix);
}
-void CPDF_Path::Append(const CFX_PathData& pData, const CFX_Matrix* pMatrix) {
- m_Ref.GetPrivateCopy()->Append(pData, pMatrix);
+void CPDF_Path::Append(const CFX_Path& path, const CFX_Matrix* pMatrix) {
+ m_Ref.GetPrivateCopy()->Append(path, pMatrix);
}
void CPDF_Path::AppendFloatRect(const CFX_FloatRect& rect) {
@@ -55,13 +55,13 @@
}
void CPDF_Path::AppendPoint(const CFX_PointF& point, FXPT_TYPE type) {
- CFX_PathData data;
+ CFX_Path data;
data.AppendPoint(point, type);
Append(data, nullptr);
}
void CPDF_Path::AppendPointAndClose(const CFX_PointF& point, FXPT_TYPE type) {
- CFX_PathData data;
+ CFX_Path data;
data.AppendPointAndClose(point, type);
Append(data, nullptr);
}
diff --git a/core/fpdfapi/page/cpdf_path.h b/core/fpdfapi/page/cpdf_path.h
index b2d1437..57b0d07 100644
--- a/core/fpdfapi/page/cpdf_path.h
+++ b/core/fpdfapi/page/cpdf_path.h
@@ -11,7 +11,7 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/shared_copy_on_write.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
class CPDF_Path {
public:
@@ -33,17 +33,17 @@
bool IsRect() const;
void Transform(const CFX_Matrix& matrix);
- void Append(const CFX_PathData& pData, const CFX_Matrix* pMatrix);
+ void Append(const CFX_Path& path, const CFX_Matrix* pMatrix);
void AppendFloatRect(const CFX_FloatRect& rect);
void AppendRect(float left, float bottom, float right, float top);
void AppendPoint(const CFX_PointF& point, FXPT_TYPE type);
void AppendPointAndClose(const CFX_PointF& point, FXPT_TYPE type);
// TODO(tsepez): Remove when all access thru this class.
- const CFX_PathData* GetObject() const { return m_Ref.GetObject(); }
+ const CFX_Path* GetObject() const { return m_Ref.GetObject(); }
private:
- SharedCopyOnWrite<CFX_RetainablePathData> m_Ref;
+ SharedCopyOnWrite<CFX_RetainablePath> m_Ref;
};
#endif // CORE_FPDFAPI_PAGE_CPDF_PATH_H_
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index 008c12a..706bf56 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -19,7 +19,7 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "third_party/base/span.h"
class CPDF_AllStates;
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index b94a6c7..de44d41 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -30,7 +30,7 @@
#include "core/fxcrt/maybe_owned.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibbase.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
@@ -483,7 +483,7 @@
bool CPDF_ImageRenderer::StartBitmapAlpha() {
if (m_pDIBBase->IsOpaqueImage()) {
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(0, 0, 1, 1);
path.Transform(m_ImageMatrix);
uint32_t fill_color =
diff --git a/core/fpdfapi/render/cpdf_rendershading.cpp b/core/fpdfapi/render/cpdf_rendershading.cpp
index ac0bca2..ff0a08f 100644
--- a/core/fpdfapi/render/cpdf_rendershading.cpp
+++ b/core/fpdfapi/render/cpdf_rendershading.cpp
@@ -27,7 +27,7 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/fx_dib.h"
#include "third_party/base/check.h"
@@ -761,7 +761,7 @@
}
int max_delta;
- CFX_PathData path;
+ CFX_Path path;
CFX_RenderDevice* pDevice;
int bNoPathSmooth;
int alpha;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 0dba6a3..0677a71 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -58,7 +58,7 @@
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_glyphbitmap.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/renderdevicedriver_iface.h"
@@ -516,19 +516,18 @@
m_LastClipPath = ClipPath;
m_pDevice->RestoreState(true);
for (size_t i = 0; i < ClipPath.GetPathCount(); ++i) {
- const CFX_PathData* pPathData = ClipPath.GetPath(i).GetObject();
- if (!pPathData)
+ const CFX_Path* pPath = ClipPath.GetPath(i).GetObject();
+ if (!pPath)
continue;
- if (pPathData->GetPoints().empty()) {
- CFX_PathData EmptyPath;
+ if (pPath->GetPoints().empty()) {
+ CFX_Path EmptyPath;
EmptyPath.AppendRect(-1, -1, 0, 0);
m_pDevice->SetClip_PathFill(&EmptyPath, nullptr,
CFX_FillRenderOptions::WindingOptions());
} else {
m_pDevice->SetClip_PathFill(
- pPathData, &mtObj2Device,
- CFX_FillRenderOptions(ClipPath.GetClipType(i)));
+ pPath, &mtObj2Device, CFX_FillRenderOptions(ClipPath.GetClipType(i)));
}
}
@@ -540,12 +539,12 @@
return;
}
- std::unique_ptr<CFX_PathData> pTextClippingPath;
+ std::unique_ptr<CFX_Path> pTextClippingPath;
for (size_t i = 0; i < ClipPath.GetTextCount(); ++i) {
CPDF_TextObject* pText = ClipPath.GetText(i);
if (pText) {
if (!pTextClippingPath)
- pTextClippingPath = std::make_unique<CFX_PathData>();
+ pTextClippingPath = std::make_unique<CFX_Path>();
ProcessText(pText, mtObj2Device, pTextClippingPath.get());
continue;
}
@@ -801,7 +800,7 @@
bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
const CFX_Matrix& mtObj2Device,
- CFX_PathData* clipping_path) {
+ CFX_Path* clipping_path) {
if (textobj->GetCharCodes().empty())
return true;
@@ -1105,7 +1104,7 @@
auto* font = charpos.m_FallbackFontPosition == -1
? pFont->GetFont()
: pFont->GetFontFallback(charpos.m_FallbackFontPosition);
- const CFX_PathData* pPath =
+ const CFX_Path* pPath =
font->LoadGlyphPath(charpos.m_GlyphIndex, charpos.m_FontCharWidth);
if (!pPath)
continue;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h
index 50c85a6..0d273d0 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.h
+++ b/core/fpdfapi/render/cpdf_renderstatus.h
@@ -21,7 +21,7 @@
#include "core/fxge/dib/fx_dib.h"
class CFX_DIBitmap;
-class CFX_PathData;
+class CFX_Path;
class CFX_RenderDevice;
class CPDF_Color;
class CPDF_Font;
@@ -161,7 +161,7 @@
const CFX_Matrix& mtObj2Device);
bool ProcessText(CPDF_TextObject* textobj,
const CFX_Matrix& mtObj2Device,
- CFX_PathData* clipping_path);
+ CFX_Path* clipping_path);
void DrawTextPathWithPattern(const CPDF_TextObject* textobj,
const CFX_Matrix& mtObj2Device,
CPDF_Font* pFont,
diff --git a/core/fpdfapi/render/cpdf_textrenderer.cpp b/core/fpdfapi/render/cpdf_textrenderer.cpp
index 785496d..2031644 100644
--- a/core/fpdfapi/render/cpdf_textrenderer.cpp
+++ b/core/fpdfapi/render/cpdf_textrenderer.cpp
@@ -13,7 +13,7 @@
#include "core/fpdfapi/render/charposlist.h"
#include "core/fpdfapi/render/cpdf_renderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_textrenderoptions.h"
#include "core/fxge/fx_font.h"
@@ -58,7 +58,7 @@
const CFX_GraphStateData* pGraphState,
FX_ARGB fill_argb,
FX_ARGB stroke_argb,
- CFX_PathData* pClippingPath,
+ CFX_Path* pClippingPath,
const CFX_FillRenderOptions& fill_options) {
std::vector<TextCharPos> pos =
GetCharPosList(char_codes, char_pos, pFont, font_size);
diff --git a/core/fpdfapi/render/cpdf_textrenderer.h b/core/fpdfapi/render/cpdf_textrenderer.h
index aaffd29..6e9853b 100644
--- a/core/fpdfapi/render/cpdf_textrenderer.h
+++ b/core/fpdfapi/render/cpdf_textrenderer.h
@@ -15,7 +15,7 @@
class CFX_RenderDevice;
class CFX_GraphStateData;
-class CFX_PathData;
+class CFX_Path;
class CPDF_RenderOptions;
class CPDF_Font;
struct CFX_FillRenderOptions;
@@ -42,7 +42,7 @@
const CFX_GraphStateData* pGraphState,
FX_ARGB fill_argb,
FX_ARGB stroke_argb,
- CFX_PathData* pClippingPath,
+ CFX_Path* pClippingPath,
const CFX_FillRenderOptions& fill_options);
static bool DrawNormalText(CFX_RenderDevice* pDevice,
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index af65813..fbddbe6 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -24,7 +24,7 @@
#include "core/fpdfdoc/cpdf_generateap.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "third_party/base/check.h"
@@ -522,7 +522,7 @@
CFX_FloatRect rect = GetRect();
rect.Deflate(width / 2, width / 2);
- CFX_PathData path;
+ CFX_Path path;
path.AppendFloatRect(rect);
CFX_FillRenderOptions fill_options;
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 465ea73..44156cc 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -48,8 +48,8 @@
"cfx_graphstate.h",
"cfx_graphstatedata.cpp",
"cfx_graphstatedata.h",
- "cfx_pathdata.cpp",
- "cfx_pathdata.h",
+ "cfx_path.cpp",
+ "cfx_path.h",
"cfx_renderdevice.cpp",
"cfx_renderdevice.h",
"cfx_substfont.cpp",
@@ -210,7 +210,7 @@
sources = [
"cfx_folderfontinfo_unittest.cpp",
"cfx_fontmapper_unittest.cpp",
- "cfx_pathdata_unittest.cpp",
+ "cfx_path_unittest.cpp",
"dib/cfx_cmyk_to_srgb_unittest.cpp",
"dib/cfx_dibbase_unittest.cpp",
"dib/cfx_dibitmap_unittest.cpp",
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 639c1a5..2cdf740 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -13,7 +13,7 @@
#include "core/fxge/cfx_cliprgn.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
@@ -964,10 +964,10 @@
// Note: BuildAggPath() has to take |agg_path| as an out-parameter. If it
// returns the agg::path_storage instead, tests will fail with MSVC builds.
-void BuildAggPath(const CFX_PathData* pPathData,
+void BuildAggPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
agg::path_storage& agg_path) {
- pdfium::span<const FX_PATHPOINT> points = pPathData->GetPoints();
+ pdfium::span<const FX_PATHPOINT> points = pPath->GetPoints();
for (size_t i = 0; i < points.size(); ++i) {
CFX_PointF pos = points[i].m_Point;
if (pObject2Device)
@@ -1123,7 +1123,7 @@
}
bool CFX_AggDeviceDriver::SetClip_PathFill(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) {
DCHECK(fill_options.fill_type != CFX_FillRenderOptions::FillType::kNoFill);
@@ -1133,7 +1133,7 @@
m_pClipRgn = std::make_unique<CFX_ClipRgn>(
GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
}
- Optional<CFX_FloatRect> maybe_rectf = pPathData->GetRect(pObject2Device);
+ Optional<CFX_FloatRect> maybe_rectf = pPath->GetRect(pObject2Device);
if (maybe_rectf.has_value()) {
CFX_FloatRect& rectf = maybe_rectf.value();
rectf.Intersect(
@@ -1144,7 +1144,7 @@
return true;
}
agg::path_storage path_data;
- BuildAggPath(pPathData, pObject2Device, path_data);
+ BuildAggPath(pPath, pObject2Device, path_data);
path_data.end_poly();
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f,
@@ -1157,7 +1157,7 @@
}
bool CFX_AggDeviceDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
if (!m_pClipRgn) {
@@ -1165,7 +1165,7 @@
GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
}
agg::path_storage path_data;
- BuildAggPath(pPathData, nullptr, path_data);
+ BuildAggPath(pPath, nullptr, path_data);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f,
static_cast<float>(GetDeviceCaps(FXDC_PIXEL_WIDTH)),
@@ -1194,7 +1194,7 @@
m_FillOptions.aliased_path);
}
-bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
+bool CFX_AggDeviceDriver::DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -1211,7 +1211,7 @@
if (fill_options.fill_type != CFX_FillRenderOptions::FillType::kNoFill &&
fill_color) {
agg::path_storage path_data;
- BuildAggPath(pPathData, pObject2Device, path_data);
+ BuildAggPath(pPath, pObject2Device, path_data);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f,
static_cast<float>(GetDeviceCaps(FXDC_PIXEL_WIDTH)),
@@ -1227,7 +1227,7 @@
if (fill_options.zero_area) {
agg::path_storage path_data;
- BuildAggPath(pPathData, pObject2Device, path_data);
+ BuildAggPath(pPath, pObject2Device, path_data);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f,
static_cast<float>(GetDeviceCaps(FXDC_PIXEL_WIDTH)),
@@ -1251,7 +1251,7 @@
}
agg::path_storage path_data;
- BuildAggPath(pPathData, &matrix1, path_data);
+ BuildAggPath(pPath, &matrix1, path_data);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f,
static_cast<float>(GetDeviceCaps(FXDC_PIXEL_WIDTH)),
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h
index 06c3c3c..8fed4ec 100644
--- a/core/fxge/agg/fx_agg_driver.h
+++ b/core/fxge/agg/fx_agg_driver.h
@@ -18,7 +18,7 @@
class CFX_ClipRgn;
class CFX_GraphStateData;
class CFX_Matrix;
-class CFX_PathData;
+class CFX_Path;
namespace pdfium {
@@ -42,13 +42,13 @@
int GetDeviceCaps(int caps_id) const override;
void SaveState() override;
void RestoreState(bool bKeepSaved) override;
- bool SetClip_PathFill(const CFX_PathData* pPathData,
+ bool SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) override;
- bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ bool SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) override;
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp
index b89dbdf..1759b97 100644
--- a/core/fxge/apple/fx_quartz_device.cpp
+++ b/core/fxge/apple/fx_quartz_device.cpp
@@ -8,7 +8,7 @@
#include "core/fxcrt/fx_extension.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_freetype.h"
diff --git a/core/fxge/cfx_drawutils.cpp b/core/fxge/cfx_drawutils.cpp
index 492d2e5..b213516 100644
--- a/core/fxge/cfx_drawutils.cpp
+++ b/core/fxge/cfx_drawutils.cpp
@@ -8,7 +8,7 @@
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "third_party/base/check.h"
@@ -17,7 +17,7 @@
const CFX_Matrix& user_to_device,
const CFX_FloatRect& view_bounding_box) {
DCHECK(render_device);
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(CFX_PointF(view_bounding_box.left, view_bounding_box.top),
FXPT_TYPE::MoveTo);
path.AppendPoint(CFX_PointF(view_bounding_box.left, view_bounding_box.bottom),
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index 7d0f850..77fe8a2 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -20,7 +20,7 @@
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_glyphcache.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/scoped_font_transform.h"
@@ -36,7 +36,7 @@
constexpr int kThousandthMaxInt = std::numeric_limits<int>::max() / 1000;
struct OUTLINE_PARAMS {
- UnownedPtr<CFX_PathData> m_pPath;
+ UnownedPtr<CFX_Path> m_pPath;
int m_CurX;
int m_CurY;
float m_CoordUnit;
@@ -636,9 +636,8 @@
FT_Set_MM_Design_Coordinates(m_Face->GetRec(), 2, coords);
}
-std::unique_ptr<CFX_PathData> CFX_Font::LoadGlyphPathImpl(
- uint32_t glyph_index,
- int dest_width) const {
+std::unique_ptr<CFX_Path> CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index,
+ int dest_width) const {
if (!m_Face)
return nullptr;
@@ -682,7 +681,7 @@
funcs.shift = 0;
funcs.delta = 0;
- auto pPath = std::make_unique<CFX_PathData>();
+ auto pPath = std::make_unique<CFX_Path>();
OUTLINE_PARAMS params;
params.m_pPath = pPath.get();
params.m_CurX = params.m_CurY = 0;
@@ -710,8 +709,8 @@
anti_alias, text_options);
}
-const CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index,
- int dest_width) const {
+const CFX_Path* CFX_Font::LoadGlyphPath(uint32_t glyph_index,
+ int dest_width) const {
return GetOrCreateGlyphCache()->LoadGlyphPath(this, glyph_index, dest_width);
}
diff --git a/core/fxge/cfx_font.h b/core/fxge/cfx_font.h
index 57ca83c..8fce408 100644
--- a/core/fxge/cfx_font.h
+++ b/core/fxge/cfx_font.h
@@ -26,7 +26,7 @@
class CFX_GlyphBitmap;
class CFX_GlyphCache;
-class CFX_PathData;
+class CFX_Path;
class CFX_SubstFont;
class IFX_SeekableReadStream;
struct CFX_TextRenderOptions;
@@ -96,7 +96,7 @@
int dest_width,
int anti_alias,
CFX_TextRenderOptions* text_options) const;
- const CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width) const;
+ const CFX_Path* LoadGlyphPath(uint32_t glyph_index, int dest_width) const;
int GetGlyphWidth(uint32_t glyph_index);
int GetAscent() const;
int GetDescent() const;
@@ -116,8 +116,8 @@
void SetSubData(uint8_t* data) { m_pGsubData.reset(data); }
pdfium::span<uint8_t> GetFontSpan() const { return m_FontData; }
void AdjustMMParams(int glyph_index, int dest_width, int weight) const;
- std::unique_ptr<CFX_PathData> LoadGlyphPathImpl(uint32_t glyph_index,
- int dest_width) const;
+ std::unique_ptr<CFX_Path> LoadGlyphPathImpl(uint32_t glyph_index,
+ int dest_width) const;
#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
CFX_TypeFace* GetDeviceCache() const;
diff --git a/core/fxge/cfx_glyphcache.cpp b/core/fxge/cfx_glyphcache.cpp
index 05107e5..c5885b1 100644
--- a/core/fxge/cfx_glyphcache.cpp
+++ b/core/fxge/cfx_glyphcache.cpp
@@ -17,7 +17,7 @@
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_glyphbitmap.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_freetype.h"
@@ -219,9 +219,9 @@
return pGlyphBitmap;
}
-const CFX_PathData* CFX_GlyphCache::LoadGlyphPath(const CFX_Font* pFont,
- uint32_t glyph_index,
- int dest_width) {
+const CFX_Path* CFX_GlyphCache::LoadGlyphPath(const CFX_Font* pFont,
+ uint32_t glyph_index,
+ int dest_width) {
if (!GetFaceRec() || glyph_index == kInvalidGlyphIndex)
return nullptr;
diff --git a/core/fxge/cfx_glyphcache.h b/core/fxge/cfx_glyphcache.h
index 565cc6e..f8d432b 100644
--- a/core/fxge/cfx_glyphcache.h
+++ b/core/fxge/cfx_glyphcache.h
@@ -24,7 +24,7 @@
class CFX_Font;
class CFX_GlyphBitmap;
class CFX_Matrix;
-class CFX_PathData;
+class CFX_Path;
struct CFX_TextRenderOptions;
class CFX_GlyphCache : public Retainable, public Observable {
@@ -39,9 +39,9 @@
int dest_width,
int anti_alias,
CFX_TextRenderOptions* text_options);
- const CFX_PathData* LoadGlyphPath(const CFX_Font* pFont,
- uint32_t glyph_index,
- int dest_width);
+ const CFX_Path* LoadGlyphPath(const CFX_Font* pFont,
+ uint32_t glyph_index,
+ int dest_width);
RetainPtr<CFX_Face> GetFace() { return m_Face; }
FXFT_FaceRec* GetFaceRec() { return m_Face ? m_Face->GetRec() : nullptr; }
@@ -81,7 +81,7 @@
RetainPtr<CFX_Face> const m_Face;
std::map<ByteString, SizeGlyphCache> m_SizeMap;
- std::map<PathMapKey, std::unique_ptr<CFX_PathData>> m_PathMap;
+ std::map<PathMapKey, std::unique_ptr<CFX_Path>> m_PathMap;
#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
sk_sp<SkTypeface> m_pTypeface;
#endif
diff --git a/core/fxge/cfx_pathdata.cpp b/core/fxge/cfx_path.cpp
similarity index 87%
rename from core/fxge/cfx_pathdata.cpp
rename to core/fxge/cfx_path.cpp
index fa083c2..3fed719 100644
--- a/core/fxge/cfx_pathdata.cpp
+++ b/core/fxge/cfx_path.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include <algorithm>
#include <iterator>
@@ -254,25 +254,25 @@
FX_PATHPOINT::~FX_PATHPOINT() = default;
-CFX_PathData::CFX_PathData() = default;
+CFX_Path::CFX_Path() = default;
-CFX_PathData::CFX_PathData(const CFX_PathData& src) = default;
+CFX_Path::CFX_Path(const CFX_Path& src) = default;
-CFX_PathData::CFX_PathData(CFX_PathData&& src) noexcept = default;
+CFX_Path::CFX_Path(CFX_Path&& src) noexcept = default;
-CFX_PathData::~CFX_PathData() = default;
+CFX_Path::~CFX_Path() = default;
-void CFX_PathData::Clear() {
+void CFX_Path::Clear() {
m_Points.clear();
}
-void CFX_PathData::ClosePath() {
+void CFX_Path::ClosePath() {
if (m_Points.empty())
return;
m_Points.back().m_CloseFigure = true;
}
-void CFX_PathData::Append(const CFX_PathData& src, const CFX_Matrix* matrix) {
+void CFX_Path::Append(const CFX_Path& src, const CFX_Matrix* matrix) {
if (src.m_Points.empty())
return;
@@ -286,16 +286,15 @@
m_Points[i].m_Point = matrix->Transform(m_Points[i].m_Point);
}
-void CFX_PathData::AppendPoint(const CFX_PointF& point, FXPT_TYPE type) {
+void CFX_Path::AppendPoint(const CFX_PointF& point, FXPT_TYPE type) {
m_Points.push_back(FX_PATHPOINT(point, type, /*close=*/false));
}
-void CFX_PathData::AppendPointAndClose(const CFX_PointF& point,
- FXPT_TYPE type) {
+void CFX_Path::AppendPointAndClose(const CFX_PointF& point, FXPT_TYPE type) {
m_Points.push_back(FX_PATHPOINT(point, type, /*close=*/true));
}
-void CFX_PathData::AppendLine(const CFX_PointF& pt1, const CFX_PointF& pt2) {
+void CFX_Path::AppendLine(const CFX_PointF& pt1, const CFX_PointF& pt2) {
if (m_Points.empty() || fabs(m_Points.back().m_Point.x - pt1.x) > 0.001 ||
fabs(m_Points.back().m_Point.y - pt1.y) > 0.001) {
AppendPoint(pt1, FXPT_TYPE::MoveTo);
@@ -303,14 +302,11 @@
AppendPoint(pt2, FXPT_TYPE::LineTo);
}
-void CFX_PathData::AppendFloatRect(const CFX_FloatRect& rect) {
+void CFX_Path::AppendFloatRect(const CFX_FloatRect& rect) {
return AppendRect(rect.left, rect.bottom, rect.right, rect.top);
}
-void CFX_PathData::AppendRect(float left,
- float bottom,
- float right,
- float top) {
+void CFX_Path::AppendRect(float left, float bottom, float right, float top) {
CFX_PointF left_bottom(left, bottom);
CFX_PointF left_top(left, top);
CFX_PointF right_top(right, top);
@@ -323,7 +319,7 @@
ClosePath();
}
-CFX_FloatRect CFX_PathData::GetBoundingBox() const {
+CFX_FloatRect CFX_Path::GetBoundingBox() const {
if (m_Points.empty())
return CFX_FloatRect();
@@ -333,9 +329,8 @@
return rect;
}
-CFX_FloatRect CFX_PathData::GetBoundingBoxForStrokePath(
- float line_width,
- float miter_limit) const {
+CFX_FloatRect CFX_Path::GetBoundingBoxForStrokePath(float line_width,
+ float miter_limit) const {
CFX_FloatRect rect(100000.0f, 100000.0f, -100000.0f, -100000.0f);
size_t iPoint = 0;
float half_width = line_width;
@@ -384,18 +379,18 @@
return rect;
}
-void CFX_PathData::Transform(const CFX_Matrix& matrix) {
+void CFX_Path::Transform(const CFX_Matrix& matrix) {
for (auto& point : m_Points)
point.m_Point = matrix.Transform(point.m_Point);
}
-bool CFX_PathData::IsRect() const {
+bool CFX_Path::IsRect() const {
if (PathPointsNeedNormalization(m_Points))
return IsRectImpl(GetNormalizedPoints(m_Points));
return IsRectImpl(m_Points);
}
-Optional<CFX_FloatRect> CFX_PathData::GetRect(const CFX_Matrix* matrix) const {
+Optional<CFX_FloatRect> CFX_Path::GetRect(const CFX_Matrix* matrix) const {
bool do_normalize = PathPointsNeedNormalization(m_Points);
std::vector<FX_PATHPOINT> normalized;
if (do_normalize)
@@ -429,19 +424,18 @@
return CreateRectFromPoints(points[0], points[2]);
}
-CFX_RetainablePathData::CFX_RetainablePathData() = default;
+CFX_RetainablePath::CFX_RetainablePath() = default;
// Note: can't default the copy constructor since Retainable<> has a deleted
// copy constructor (as it should). Instead, we want the default Retainable<>
// constructor to be invoked so as to create a copy with a ref-count of 1 as
// of the time it is created, then populate the remainder of the members from
// the |src| object.
-CFX_RetainablePathData::CFX_RetainablePathData(
- const CFX_RetainablePathData& src)
- : CFX_PathData(src) {}
+CFX_RetainablePath::CFX_RetainablePath(const CFX_RetainablePath& src)
+ : CFX_Path(src) {}
-CFX_RetainablePathData::~CFX_RetainablePathData() = default;
+CFX_RetainablePath::~CFX_RetainablePath() = default;
-RetainPtr<CFX_RetainablePathData> CFX_RetainablePathData::Clone() const {
- return pdfium::MakeRetain<CFX_RetainablePathData>(*this);
+RetainPtr<CFX_RetainablePath> CFX_RetainablePath::Clone() const {
+ return pdfium::MakeRetain<CFX_RetainablePath>(*this);
}
diff --git a/core/fxge/cfx_pathdata.h b/core/fxge/cfx_path.h
similarity index 77%
rename from core/fxge/cfx_pathdata.h
rename to core/fxge/cfx_path.h
index ed25c95..b0560d1 100644
--- a/core/fxge/cfx_pathdata.h
+++ b/core/fxge/cfx_path.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef CORE_FXGE_CFX_PATHDATA_H_
-#define CORE_FXGE_CFX_PATHDATA_H_
+#ifndef CORE_FXGE_CFX_PATH_H_
+#define CORE_FXGE_CFX_PATH_H_
#include <vector>
@@ -32,12 +32,12 @@
bool m_CloseFigure;
};
-class CFX_PathData {
+class CFX_Path {
public:
- CFX_PathData();
- CFX_PathData(const CFX_PathData& src);
- CFX_PathData(CFX_PathData&& src) noexcept;
- ~CFX_PathData();
+ CFX_Path();
+ CFX_Path(const CFX_Path& src);
+ CFX_Path(CFX_Path&& src) noexcept;
+ ~CFX_Path();
void Clear();
@@ -58,7 +58,7 @@
bool IsRect() const;
Optional<CFX_FloatRect> GetRect(const CFX_Matrix* matrix) const;
- void Append(const CFX_PathData& src, const CFX_Matrix* matrix);
+ void Append(const CFX_Path& src, const CFX_Matrix* matrix);
void AppendFloatRect(const CFX_FloatRect& rect);
void AppendRect(float left, float bottom, float right, float top);
void AppendLine(const CFX_PointF& pt1, const CFX_PointF& pt2);
@@ -70,16 +70,16 @@
std::vector<FX_PATHPOINT> m_Points;
};
-class CFX_RetainablePathData final : public Retainable, public CFX_PathData {
+class CFX_RetainablePath final : public Retainable, public CFX_Path {
public:
CONSTRUCT_VIA_MAKE_RETAIN;
- RetainPtr<CFX_RetainablePathData> Clone() const;
+ RetainPtr<CFX_RetainablePath> Clone() const;
private:
- CFX_RetainablePathData();
- CFX_RetainablePathData(const CFX_RetainablePathData& src);
- ~CFX_RetainablePathData() override;
+ CFX_RetainablePath();
+ CFX_RetainablePath(const CFX_RetainablePath& src);
+ ~CFX_RetainablePath() override;
};
-#endif // CORE_FXGE_CFX_PATHDATA_H_
+#endif // CORE_FXGE_CFX_PATH_H_
diff --git a/core/fxge/cfx_pathdata_unittest.cpp b/core/fxge/cfx_path_unittest.cpp
similarity index 95%
rename from core/fxge/cfx_pathdata_unittest.cpp
rename to core/fxge/cfx_path_unittest.cpp
index c7cf3ce..5ffe212 100644
--- a/core/fxge/cfx_pathdata_unittest.cpp
+++ b/core/fxge/cfx_path_unittest.cpp
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "testing/gtest/include/gtest/gtest.h"
-TEST(CFX_PathData, BasicTest) {
- CFX_PathData path;
+TEST(CFX_Path, BasicTest) {
+ CFX_Path path;
path.AppendRect(/*left=*/1, /*bottom=*/2, /*right=*/3, /*top=*/5);
EXPECT_EQ(5u, path.GetPoints().size());
EXPECT_TRUE(path.IsRect());
@@ -64,8 +64,8 @@
EXPECT_EQ(CFX_FloatRect(1, 2, 3, 5), path.GetBoundingBox());
}
-TEST(CFX_PathData, ShearTransform) {
- CFX_PathData path;
+TEST(CFX_Path, ShearTransform) {
+ CFX_Path path;
path.AppendRect(/*left=*/1, /*bottom=*/2, /*right=*/3, /*top=*/5);
const CFX_Matrix kShearMatrix(1, 2, 0, 1, 0, 0);
@@ -94,8 +94,8 @@
EXPECT_EQ(CFX_FloatRect(1, 2, 3, 5), path.GetBoundingBox());
}
-TEST(CFX_PathData, Hexagon) {
- CFX_PathData path;
+TEST(CFX_Path, Hexagon) {
+ CFX_Path path;
path.AppendPoint({1, 0}, FXPT_TYPE::MoveTo);
path.AppendPoint({2, 0}, FXPT_TYPE::LineTo);
path.AppendPoint({3, 1}, FXPT_TYPE::LineTo);
@@ -138,8 +138,8 @@
EXPECT_EQ(CFX_FloatRect(0, 0, 3, 2), path.GetBoundingBox());
}
-TEST(CFX_PathData, ClosePath) {
- CFX_PathData path;
+TEST(CFX_Path, ClosePath) {
+ CFX_Path path;
path.AppendLine({0, 0}, {0, 1});
path.AppendLine({0, 1}, {1, 1});
path.AppendLine({1, 1}, {1, 0});
@@ -188,8 +188,8 @@
EXPECT_EQ(CFX_FloatRect(0, 0, 1, 1), rect.value());
}
-TEST(CFX_PathData, FivePointRect) {
- CFX_PathData path;
+TEST(CFX_Path, FivePointRect) {
+ CFX_Path path;
path.AppendPoint({0, 0}, FXPT_TYPE::MoveTo);
path.AppendPoint({2, 0}, FXPT_TYPE::LineTo);
path.AppendPoint({2, 1}, FXPT_TYPE::LineTo);
@@ -213,8 +213,8 @@
EXPECT_EQ(CFX_FloatRect(0, 0, 2, 1), rect.value());
}
-TEST(CFX_PathData, SixPlusPointRect) {
- CFX_PathData path;
+TEST(CFX_Path, SixPlusPointRect) {
+ CFX_Path path;
path.AppendPoint({0, 0}, FXPT_TYPE::MoveTo);
path.AppendPoint({0, 0}, FXPT_TYPE::LineTo);
path.AppendPoint({2, 0}, FXPT_TYPE::LineTo);
@@ -248,8 +248,8 @@
EXPECT_EQ(CFX_FloatRect(0, 0, 2, 1), path.GetBoundingBox());
}
-TEST(CFX_PathData, NotRect) {
- CFX_PathData path;
+TEST(CFX_Path, NotRect) {
+ CFX_Path path;
path.AppendPoint({0, 0}, FXPT_TYPE::MoveTo);
path.AppendPoint({2, 0}, FXPT_TYPE::LineTo);
path.AppendPoint({2, 1}, FXPT_TYPE::LineTo);
@@ -332,9 +332,9 @@
EXPECT_EQ(CFX_FloatRect(0, 0, 2, 2), path.GetBoundingBox());
}
-TEST(CFX_PathData, EmptyRect) {
+TEST(CFX_Path, EmptyRect) {
// Document existing behavior where an empty rect is still considered a rect.
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint({0, 0}, FXPT_TYPE::MoveTo);
path.AppendPoint({0, 0}, FXPT_TYPE::LineTo);
path.AppendPoint({0, 1}, FXPT_TYPE::LineTo);
@@ -347,13 +347,13 @@
EXPECT_EQ(CFX_FloatRect(0, 0, 0, 1), path.GetBoundingBox());
}
-TEST(CFX_PathData, Append) {
- CFX_PathData path;
+TEST(CFX_Path, Append) {
+ CFX_Path path;
path.AppendPoint({5, 6}, FXPT_TYPE::MoveTo);
ASSERT_EQ(1u, path.GetPoints().size());
EXPECT_EQ(CFX_PointF(5, 6), path.GetPoint(0));
- CFX_PathData empty_path;
+ CFX_Path empty_path;
path.Append(empty_path, nullptr);
ASSERT_EQ(1u, path.GetPoints().size());
EXPECT_EQ(CFX_PointF(5, 6), path.GetPoint(0));
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index b697774..3ab703d 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -21,7 +21,7 @@
#include "core/fxge/cfx_glyphbitmap.h"
#include "core/fxge/cfx_glyphcache.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_textrenderoptions.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
@@ -320,7 +320,7 @@
bool CheckSimpleLinePath(pdfium::span<const FX_PATHPOINT> points,
const CFX_Matrix* matrix,
bool adjust,
- CFX_PathData* new_path,
+ CFX_Path* new_path,
bool* thin,
bool* set_identity) {
if (points.size() != 2 && points.size() != 3)
@@ -360,14 +360,14 @@
// Returns true if `points` is palindromic and forms zero area. Otherwise,
// returns false.
bool CheckPalindromicPath(pdfium::span<const FX_PATHPOINT> points,
- CFX_PathData* new_path,
+ CFX_Path* new_path,
bool* thin) {
if (points.size() <= 3 || !(points.size() % 2))
return false;
const int mid = points.size() / 2;
bool zero_area = true;
- CFX_PathData temp_path;
+ CFX_Path temp_path;
for (int i = 0; i < mid; i++) {
if (!(points[mid - i - 1].m_Point == points[mid + i + 1].m_Point &&
points[mid - i - 1].m_Type != FXPT_TYPE::BezierTo &&
@@ -409,7 +409,7 @@
bool GetZeroAreaPath(pdfium::span<const FX_PATHPOINT> points,
const CFX_Matrix* matrix,
bool adjust,
- CFX_PathData* new_path,
+ CFX_Path* new_path,
bool* thin,
bool* set_identity) {
*set_identity = false;
@@ -568,11 +568,10 @@
}
bool CFX_RenderDevice::SetClip_PathFill(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) {
- if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device,
- fill_options)) {
+ if (!m_pDeviceDriver->SetClip_PathFill(pPath, pObject2Device, fill_options)) {
return false;
}
UpdateClipBox();
@@ -580,10 +579,10 @@
}
bool CFX_RenderDevice::SetClip_PathStroke(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
- if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device,
+ if (!m_pDeviceDriver->SetClip_PathStroke(pPath, pObject2Device,
pGraphState)) {
return false;
}
@@ -592,7 +591,7 @@
}
bool CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) {
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(rect.left, rect.bottom, rect.right, rect.top);
if (!SetClip_PathFill(&path, nullptr,
CFX_FillRenderOptions::WindingOptions()))
@@ -611,18 +610,18 @@
m_ClipBox.bottom = m_Height;
}
-bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
+bool CFX_RenderDevice::DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
uint32_t stroke_color,
const CFX_FillRenderOptions& fill_options) {
- return DrawPathWithBlend(pPathData, pObject2Device, pGraphState, fill_color,
+ return DrawPathWithBlend(pPath, pObject2Device, pGraphState, fill_color,
stroke_color, fill_options, BlendMode::kNormal);
}
bool CFX_RenderDevice::DrawPathWithBlend(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -633,7 +632,7 @@
fill_options.fill_type != CFX_FillRenderOptions::FillType::kNoFill;
uint8_t fill_alpha = fill ? FXARGB_A(fill_color) : 0;
uint8_t stroke_alpha = pGraphState ? FXARGB_A(stroke_color) : 0;
- pdfium::span<const FX_PATHPOINT> points = pPathData->GetPoints();
+ pdfium::span<const FX_PATHPOINT> points = pPath->GetPoints();
if (stroke_alpha == 0 && points.size() == 2) {
CFX_PointF pos1 = points[0].m_Point;
CFX_PointF pos2 = points[1].m_Point;
@@ -646,7 +645,7 @@
}
if (stroke_alpha == 0 && !fill_options.rect_aa) {
- Optional<CFX_FloatRect> maybe_rect_f = pPathData->GetRect(pObject2Device);
+ Optional<CFX_FloatRect> maybe_rect_f = pPath->GetRect(pObject2Device);
if (maybe_rect_f.has_value()) {
const CFX_FloatRect& rect_f = maybe_rect_f.value();
FX_RECT rect_i = rect_f.GetOuterRect();
@@ -728,22 +727,21 @@
if (fill && fill_alpha && stroke_alpha < 0xff && fill_options.stroke) {
if (m_RenderCaps & FXRC_FILLSTROKE_PATH) {
- return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState,
+ return m_pDeviceDriver->DrawPath(pPath, pObject2Device, pGraphState,
fill_color, stroke_color, fill_options,
blend_type);
}
- return DrawFillStrokePath(pPathData, pObject2Device, pGraphState,
- fill_color, stroke_color, fill_options,
- blend_type);
+ return DrawFillStrokePath(pPath, pObject2Device, pGraphState, fill_color,
+ stroke_color, fill_options, blend_type);
}
- return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState,
+ return m_pDeviceDriver->DrawPath(pPath, pObject2Device, pGraphState,
fill_color, stroke_color, fill_options,
blend_type);
}
// This can be removed once PDFium entirely relies on Skia
bool CFX_RenderDevice::DrawFillStrokePath(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -754,10 +752,10 @@
return false;
CFX_FloatRect bbox;
if (pGraphState) {
- bbox = pPathData->GetBoundingBoxForStrokePath(pGraphState->m_LineWidth,
- pGraphState->m_MiterLimit);
+ bbox = pPath->GetBoundingBoxForStrokePath(pGraphState->m_LineWidth,
+ pGraphState->m_MiterLimit);
} else {
- bbox = pPathData->GetBoundingBox();
+ bbox = pPath->GetBoundingBox();
}
if (pObject2Device)
bbox = pObject2Device->TransformRect(bbox);
@@ -786,9 +784,9 @@
if (pObject2Device)
matrix = *pObject2Device;
matrix.Translate(-rect.left, -rect.top);
- if (!bitmap_device.GetDeviceDriver()->DrawPath(
- pPathData, &matrix, pGraphState, fill_color, stroke_color,
- fill_options, blend_type)) {
+ if (!bitmap_device.GetDeviceDriver()->DrawPath(pPath, &matrix, pGraphState,
+ fill_color, stroke_color,
+ fill_options, blend_type)) {
return false;
}
#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
@@ -835,7 +833,7 @@
return true;
}
CFX_GraphStateData graph_state;
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(ptMoveTo, FXPT_TYPE::MoveTo);
path.AppendPoint(ptLineTo, FXPT_TYPE::LineTo);
return m_pDeviceDriver->DrawPath(&path, nullptr, &graph_state, 0, color,
@@ -852,7 +850,7 @@
if (path.empty())
return;
- CFX_PathData new_path;
+ CFX_Path new_path;
bool thin = false;
bool set_identity = false;
@@ -1230,7 +1228,7 @@
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
FX_ARGB stroke_color,
- CFX_PathData* pClippingPath,
+ CFX_Path* pClippingPath,
const CFX_FillRenderOptions& fill_options) {
for (int iChar = 0; iChar < nChars; ++iChar) {
const TextCharPos& charpos = pCharPos[iChar];
@@ -1242,14 +1240,14 @@
}
matrix.Concat(CFX_Matrix(font_size, 0, 0, font_size, charpos.m_Origin.x,
charpos.m_Origin.y));
- const CFX_PathData* pPath =
+ const CFX_Path* pPath =
pFont->LoadGlyphPath(charpos.m_GlyphIndex, charpos.m_FontCharWidth);
if (!pPath)
continue;
matrix.Concat(mtText2User);
- CFX_PathData TransformedPath(*pPath);
+ CFX_Path TransformedPath(*pPath);
TransformedPath.Transform(matrix);
if (fill_color || stroke_color) {
CFX_FillRenderOptions options(fill_options);
@@ -1271,7 +1269,7 @@
void CFX_RenderDevice::DrawFillRect(const CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
const FX_COLORREF& color) {
- CFX_PathData path;
+ CFX_Path path;
path.AppendFloatRect(rect);
DrawPath(&path, pUser2Device, nullptr, color, 0,
CFX_FillRenderOptions::WindingOptions());
@@ -1281,7 +1279,7 @@
const std::vector<CFX_PointF>& points,
const FX_COLORREF& color) {
DCHECK(!points.empty());
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(points[0], FXPT_TYPE::MoveTo);
for (size_t i = 1; i < points.size(); ++i)
path.AppendPoint(points[i], FXPT_TYPE::LineTo);
@@ -1297,7 +1295,7 @@
CFX_GraphStateData gsd;
gsd.m_LineWidth = fWidth;
- CFX_PathData path;
+ CFX_Path path;
path.AppendFloatRect(rect);
DrawPath(&path, &mtUser2Device, &gsd, 0, color,
CFX_FillRenderOptions::EvenOddOptions());
@@ -1308,7 +1306,7 @@
const CFX_PointF& ptLineTo,
const FX_COLORREF& color,
float fWidth) {
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(ptMoveTo, FXPT_TYPE::MoveTo);
path.AppendPoint(ptLineTo, FXPT_TYPE::LineTo);
@@ -1388,7 +1386,7 @@
switch (nStyle) {
default:
case BorderStyle::kSolid: {
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(fLeft, fBottom, fRight, fTop);
path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth,
fTop - fWidth);
@@ -1402,7 +1400,7 @@
gsd.m_DashPhase = 0;
gsd.m_LineWidth = fWidth;
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fBottom + fHalfWidth),
FXPT_TYPE::MoveTo);
path.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fTop - fHalfWidth),
@@ -1422,7 +1420,7 @@
CFX_GraphStateData gsd;
gsd.m_LineWidth = fHalfWidth;
- CFX_PathData path_left_top;
+ CFX_Path path_left_top;
path_left_top.AppendPoint(
CFX_PointF(fLeft + fHalfWidth, fBottom + fHalfWidth),
FXPT_TYPE::MoveTo);
@@ -1444,7 +1442,7 @@
crLeftTop.ToFXColor(nTransparency), 0,
CFX_FillRenderOptions::EvenOddOptions());
- CFX_PathData path_right_bottom;
+ CFX_Path path_right_bottom;
path_right_bottom.AppendPoint(
CFX_PointF(fRight - fHalfWidth, fTop - fHalfWidth),
FXPT_TYPE::MoveTo);
@@ -1467,7 +1465,7 @@
crRightBottom.ToFXColor(nTransparency), 0,
CFX_FillRenderOptions::EvenOddOptions());
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(fLeft, fBottom, fRight, fTop);
path.AppendRect(fLeft + fHalfWidth, fBottom + fHalfWidth,
fRight - fHalfWidth, fTop - fHalfWidth);
@@ -1479,7 +1477,7 @@
CFX_GraphStateData gsd;
gsd.m_LineWidth = fWidth;
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(CFX_PointF(fLeft, fBottom + fHalfWidth),
FXPT_TYPE::MoveTo);
path.AppendPoint(CFX_PointF(fRight, fBottom + fHalfWidth),
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 4f45678..95f44a4 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -23,7 +23,7 @@
class CFX_Font;
class CFX_GraphStateData;
class CFX_ImageRenderer;
-class CFX_PathData;
+class CFX_Path;
class FX_PATHPOINT;
class PauseIndicatorIface;
class TextCharPos;
@@ -73,20 +73,20 @@
int height) const;
const FX_RECT& GetClipBox() const { return m_ClipBox; }
void SetBaseClip(const FX_RECT& rect);
- bool SetClip_PathFill(const CFX_PathData* pPathData,
+ bool SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options);
- bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ bool SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState);
bool SetClip_Rect(const FX_RECT& pRect);
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
uint32_t stroke_color,
const CFX_FillRenderOptions& fill_options);
- bool DrawPathWithBlend(const CFX_PathData* pPathData,
+ bool DrawPathWithBlend(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -173,7 +173,7 @@
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
uint32_t stroke_color,
- CFX_PathData* pClippingPath,
+ CFX_Path* pClippingPath,
const CFX_FillRenderOptions& fill_options);
void DrawFillRect(const CFX_Matrix* pUser2Device,
@@ -232,7 +232,7 @@
private:
void InitDeviceInfo();
void UpdateClipBox();
- bool DrawFillStrokePath(const CFX_PathData* pPathData,
+ bool DrawFillStrokePath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp b/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp
index b0df665..674913f 100644
--- a/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp
+++ b/core/fxge/cfx_windowsrenderdevice_embeddertest.cpp
@@ -9,7 +9,7 @@
#include <memory>
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "testing/embedder_test.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -44,7 +44,7 @@
};
TEST_F(CFX_WindowsRenderDeviceTest, SimpleClipTriangle) {
- CFX_PathData path_data;
+ CFX_Path path_data;
CFX_PointF p1(0.0f, 0.0f);
CFX_PointF p2(0.0f, 100.0f);
CFX_PointF p3(100.0f, 100.0f);
@@ -58,7 +58,7 @@
}
TEST_F(CFX_WindowsRenderDeviceTest, SimpleClipRect) {
- CFX_PathData path_data;
+ CFX_Path path_data;
path_data.AppendRect(0.0f, 100.0f, 200.0f, 0.0f);
path_data.ClosePath();
@@ -67,7 +67,7 @@
}
TEST_F(CFX_WindowsRenderDeviceTest, GargantuanClipRect) {
- CFX_PathData path_data;
+ CFX_Path path_data;
path_data.AppendRect(-257698020.0f, -257697252.0f, 257698044.0f,
257698812.0f);
@@ -81,7 +81,7 @@
}
TEST_F(CFX_WindowsRenderDeviceTest, GargantuanClipRectWithBaseClip) {
- CFX_PathData path_data;
+ CFX_Path path_data;
const FX_RECT kBaseClip(0, 0, 5100, 6600);
m_driver->SetBaseClip(kBaseClip);
diff --git a/core/fxge/renderdevicedriver_iface.cpp b/core/fxge/renderdevicedriver_iface.cpp
index d6f1cfd..436d70e 100644
--- a/core/fxge/renderdevicedriver_iface.cpp
+++ b/core/fxge/renderdevicedriver_iface.cpp
@@ -7,13 +7,13 @@
#include "core/fxge/renderdevicedriver_iface.h"
#include "core/fxcrt/fx_coordinates.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibitmap.h"
RenderDeviceDriverIface::~RenderDeviceDriverIface() = default;
bool RenderDeviceDriverIface::SetClip_PathStroke(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
return false;
diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h
index a11b5f2..eef94bf 100644
--- a/core/fxge/renderdevicedriver_iface.h
+++ b/core/fxge/renderdevicedriver_iface.h
@@ -20,7 +20,7 @@
class CFX_GraphStateData;
class CFX_ImageRenderer;
class CFX_Matrix;
-class CFX_PathData;
+class CFX_Path;
class CPDF_ShadingPattern;
class PauseIndicatorIface;
class TextCharPos;
@@ -44,13 +44,13 @@
virtual void RestoreState(bool bKeepSaved) = 0;
virtual void SetBaseClip(const FX_RECT& rect);
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual bool SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) = 0;
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ virtual bool SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState);
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index d57008c..908b45d 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -25,7 +25,7 @@
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_font.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_textrenderoptions.h"
#include "core/fxge/dib/cfx_bitmapcomposer.h"
@@ -325,9 +325,9 @@
fill == SkPathFillType::kInverseEvenOdd;
}
-SkPath BuildPath(const CFX_PathData* pPathData) {
+SkPath BuildPath(const CFX_Path* pPath) {
SkPath sk_path;
- pdfium::span<const FX_PATHPOINT> points = pPathData->GetPoints();
+ pdfium::span<const FX_PATHPOINT> points = pPath->GetPoints();
for (size_t i = 0; i < points.size(); ++i) {
const CFX_PointF& point = points[i].m_Point;
FXPT_TYPE point_type = points[i].m_Type;
@@ -750,7 +750,7 @@
// mark all cached state as uninitialized
explicit SkiaState(CFX_SkiaDeviceDriver* pDriver) : m_pDriver(pDriver) {}
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pMatrix,
const CFX_GraphStateData* pDrawState,
uint32_t fill_color,
@@ -786,7 +786,7 @@
m_drawIndex = m_commandIndex;
m_type = Accumulator::kPath;
}
- SkPath skPath = BuildPath(pPathData);
+ SkPath skPath = BuildPath(pPath);
SkPoint delta;
if (MatrixOffset(pMatrix, &delta))
skPath.offset(delta.fX, delta.fY);
@@ -1048,16 +1048,15 @@
bool IsEmpty() const { return !m_commands.count(); }
- bool SetClipFill(const CFX_PathData* pPathData,
+ bool SetClipFill(const CFX_Path* pPath,
const CFX_Matrix* pMatrix,
const CFX_FillRenderOptions& fill_options) {
if (m_debugDisable)
return false;
Dump(__func__);
SkPath skClipPath;
- if (pPathData->GetPoints().size() == 5 ||
- pPathData->GetPoints().size() == 4) {
- Optional<CFX_FloatRect> maybe_rectf = pPathData->GetRect(pMatrix);
+ if (pPath->GetPoints().size() == 5 || pPath->GetPoints().size() == 4) {
+ Optional<CFX_FloatRect> maybe_rectf = pPath->GetRect(pMatrix);
if (maybe_rectf.has_value()) {
CFX_FloatRect& rectf = maybe_rectf.value();
rectf.Intersect(CFX_FloatRect(
@@ -1071,7 +1070,7 @@
}
}
if (skClipPath.isEmpty()) {
- skClipPath = BuildPath(pPathData);
+ skClipPath = BuildPath(pPath);
skClipPath.setFillType(GetAlternateOrWindingFillType(fill_options));
SkMatrix skMatrix = ToSkMatrix(*pMatrix);
skClipPath.transform(skMatrix);
@@ -1107,13 +1106,13 @@
return true;
}
- bool SetClipStroke(const CFX_PathData* pPathData,
+ bool SetClipStroke(const CFX_Path* pPath,
const CFX_Matrix* pMatrix,
const CFX_GraphStateData* pGraphState) {
if (m_debugDisable)
return false;
Dump(__func__);
- SkPath skPath = BuildPath(pPathData);
+ SkPath skPath = BuildPath(pPath);
SkMatrix skMatrix = ToSkMatrix(*pMatrix);
SkPaint skPaint;
m_pDriver->PaintStroke(&skPaint, pGraphState, skMatrix);
@@ -1979,22 +1978,21 @@
#endif // defined(_SKIA_SUPPORT_PATHS_)
bool CFX_SkiaDeviceDriver::SetClip_PathFill(
- const CFX_PathData* pPathData, // path info
+ const CFX_Path* pPath, // path info
const CFX_Matrix* pObject2Device, // flips object's y-axis
const CFX_FillRenderOptions& fill_options) {
m_FillOptions = fill_options;
CFX_Matrix identity;
const CFX_Matrix* deviceMatrix = pObject2Device ? pObject2Device : &identity;
- bool cached = m_pCache->SetClipFill(pPathData, deviceMatrix, fill_options);
+ bool cached = m_pCache->SetClipFill(pPath, deviceMatrix, fill_options);
#if defined(_SKIA_SUPPORT_PATHS_)
if (!m_pClipRgn) {
m_pClipRgn = std::make_unique<CFX_ClipRgn>(
GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
}
#endif
- if (pPathData->GetPoints().size() == 5 ||
- pPathData->GetPoints().size() == 4) {
- Optional<CFX_FloatRect> maybe_rectf = pPathData->GetRect(deviceMatrix);
+ if (pPath->GetPoints().size() == 5 || pPath->GetPoints().size() == 4) {
+ Optional<CFX_FloatRect> maybe_rectf = pPath->GetRect(deviceMatrix);
if (maybe_rectf.has_value()) {
CFX_FloatRect& rectf = maybe_rectf.value();
rectf.Intersect(CFX_FloatRect(0, 0,
@@ -2016,7 +2014,7 @@
return true;
}
}
- SkPath skClipPath = BuildPath(pPathData);
+ SkPath skClipPath = BuildPath(pPath);
skClipPath.setFillType(GetAlternateOrWindingFillType(fill_options));
SkMatrix skMatrix = ToSkMatrix(*deviceMatrix);
skClipPath.transform(skMatrix);
@@ -2035,11 +2033,11 @@
}
bool CFX_SkiaDeviceDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData, // path info
+ const CFX_Path* pPath, // path info
const CFX_Matrix* pObject2Device, // required transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
- ) {
- bool cached = m_pCache->SetClipStroke(pPathData, pObject2Device, pGraphState);
+) {
+ bool cached = m_pCache->SetClipStroke(pPath, pObject2Device, pGraphState);
#if defined(_SKIA_SUPPORT_PATHS_)
if (!m_pClipRgn) {
@@ -2048,7 +2046,7 @@
}
#endif
// build path data
- SkPath skPath = BuildPath(pPathData);
+ SkPath skPath = BuildPath(pPath);
SkMatrix skMatrix = ToSkMatrix(*pObject2Device);
SkPaint skPaint;
PaintStroke(&skPaint, pGraphState, skMatrix);
@@ -2069,7 +2067,7 @@
}
bool CFX_SkiaDeviceDriver::DrawPath(
- const CFX_PathData* pPathData, // path info
+ const CFX_Path* pPath, // path info
const CFX_Matrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState, // graphic state, for pen attributes
uint32_t fill_color, // fill color
@@ -2077,7 +2075,7 @@
const CFX_FillRenderOptions& fill_options,
BlendMode blend_type) {
m_FillOptions = fill_options;
- if (m_pCache->DrawPath(pPathData, pObject2Device, pGraphState, fill_color,
+ if (m_pCache->DrawPath(pPath, pObject2Device, pGraphState, fill_color,
stroke_color, fill_options, blend_type)) {
return true;
}
@@ -2094,7 +2092,7 @@
bool is_paint_stroke = pGraphState && stroke_alpha;
if (is_paint_stroke)
PaintStroke(&skPaint, pGraphState, skMatrix);
- SkPath skPath = BuildPath(pPathData);
+ SkPath skPath = BuildPath(pPath);
SkAutoCanvasRestore scoped_save_restore(m_pCanvas, /*doSave=*/true);
m_pCanvas->concat(skMatrix);
bool do_stroke = true;
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index e6d64c0..1a68354 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -12,7 +12,7 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/renderdevicedriver_iface.h"
class CFX_ClipRgn;
@@ -47,21 +47,21 @@
/** Set clipping path using filled region */
bool SetClip_PathFill(
- const CFX_PathData* pPathData, // path info
+ const CFX_Path* pPath, // path info
const CFX_Matrix* pObject2Device, // optional transformation
const CFX_FillRenderOptions& fill_options) // fill options
override;
/** Set clipping path using stroked region */
bool SetClip_PathStroke(
- const CFX_PathData* pPathData, // path info
+ const CFX_Path* pPath, // path info
const CFX_Matrix* pObject2Device, // required transformation
const CFX_GraphStateData*
pGraphState) // graphic state, for pen attributes
override;
/** Draw a path */
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/skia/fx_skia_device_embeddertest.cpp b/core/fxge/skia/fx_skia_device_embeddertest.cpp
index 1f94483..2aa8718 100644
--- a/core/fxge/skia/fx_skia_device_embeddertest.cpp
+++ b/core/fxge/skia/fx_skia_device_embeddertest.cpp
@@ -6,7 +6,7 @@
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_font.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_textrenderoptions.h"
#include "core/fxge/skia/fx_skia_device.h"
@@ -46,14 +46,14 @@
CFX_Font font;
float fontSize = 1;
- CFX_PathData clipPath;
- CFX_PathData clipPath2;
+ CFX_Path clipPath;
+ CFX_Path clipPath2;
clipPath.AppendRect(0, 0, 3, 1);
clipPath2.AppendRect(0, 0, 2, 1);
CFX_Matrix clipMatrix;
CFX_Matrix clipMatrix2(1, 0, 0, 1, 0, 1);
driver->SaveState();
- CFX_PathData path1;
+ CFX_Path path1;
path1.AppendRect(0, 0, 1, 2);
CFX_Matrix matrix;
@@ -75,7 +75,7 @@
}
if (state.m_save == State::Save::kYes)
driver->RestoreState(true);
- CFX_PathData path2;
+ CFX_Path path2;
path2.AppendRect(0, 0, 2, 2);
if (state.m_change == State::Change::kYes) {
if (state.m_graphic == State::Graphic::kPath)
@@ -103,7 +103,7 @@
}
void OutOfSequenceClipTest(CFX_SkiaDeviceDriver* driver, const State&) {
- CFX_PathData clipPath;
+ CFX_Path clipPath;
clipPath.AppendRect(1, 0, 3, 1);
CFX_Matrix clipMatrix;
driver->SaveState();
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 48653a5..9d50617 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -17,7 +17,7 @@
#include "core/fxge/cfx_fontcache.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_glyphcache.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_dibextractor.h"
#include "core/fxge/dib/cfx_dibitmap.h"
@@ -108,15 +108,15 @@
m_ClipBoxStack.pop_back();
}
-void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData,
+void CFX_PSRenderer::OutputPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device) {
std::ostringstream buf;
- size_t size = pPathData->GetPoints().size();
+ size_t size = pPath->GetPoints().size();
for (size_t i = 0; i < size; i++) {
- FXPT_TYPE type = pPathData->GetType(i);
- bool closing = pPathData->IsClosingFigure(i);
- CFX_PointF pos = pPathData->GetPoint(i);
+ FXPT_TYPE type = pPath->GetType(i);
+ bool closing = pPath->IsClosingFigure(i);
+ CFX_PointF pos = pPath->GetPoint(i);
if (pObject2Device)
pos = pObject2Device->Transform(pos);
@@ -131,8 +131,8 @@
buf << "h ";
break;
case FXPT_TYPE::BezierTo: {
- CFX_PointF pos1 = pPathData->GetPoint(i + 1);
- CFX_PointF pos2 = pPathData->GetPoint(i + 2);
+ CFX_PointF pos1 = pPath->GetPoint(i + 1);
+ CFX_PointF pos2 = pPath->GetPoint(i + 2);
if (pObject2Device) {
pos1 = pObject2Device->Transform(pos1);
pos2 = pObject2Device->Transform(pos2);
@@ -151,12 +151,12 @@
}
void CFX_PSRenderer::SetClip_PathFill(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) {
StartRendering();
- OutputPath(pPathData, pObject2Device);
- CFX_FloatRect rect = pPathData->GetBoundingBox();
+ OutputPath(pPath, pObject2Device);
+ CFX_FloatRect rect = pPath->GetBoundingBox();
if (pObject2Device)
rect = pObject2Device->TransformRect(rect);
@@ -171,7 +171,7 @@
m_pStream->WriteString(" n\n");
}
-void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
+void CFX_PSRenderer::SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
StartRendering();
@@ -183,15 +183,15 @@
<< pObject2Device->e << " " << pObject2Device->f << "]cm ";
WriteToStream(&buf);
- OutputPath(pPathData, nullptr);
- CFX_FloatRect rect = pPathData->GetBoundingBoxForStrokePath(
+ OutputPath(pPath, nullptr);
+ CFX_FloatRect rect = pPath->GetBoundingBoxForStrokePath(
pGraphState->m_LineWidth, pGraphState->m_MiterLimit);
m_ClipBox.Intersect(pObject2Device->TransformRect(rect).GetOuterRect());
m_pStream->WriteString("strokepath W n sm\n");
}
-bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
+bool CFX_PSRenderer::DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -218,7 +218,7 @@
}
}
- OutputPath(pPathData, stroke_alpha ? nullptr : pObject2Device);
+ OutputPath(pPath, stroke_alpha ? nullptr : pObject2Device);
if (fill_options.fill_type != CFX_FillRenderOptions::FillType::kNoFill &&
fill_alpha) {
SetColor(fill_color);
@@ -516,12 +516,12 @@
CFX_Matrix(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
}
- const CFX_PathData* pPathData = pGlyphCache->LoadGlyphPath(
+ const CFX_Path* pPath = pGlyphCache->LoadGlyphPath(
pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
- if (!pPathData)
+ if (!pPath)
return;
- CFX_PathData TransformedPath(*pPathData);
+ CFX_Path TransformedPath(*pPath);
if (charpos.m_bGlyphAdjust)
TransformedPath.Transform(matrix);
diff --git a/core/fxge/win32/cfx_psrenderer.h b/core/fxge/win32/cfx_psrenderer.h
index 0136092..74153e0 100644
--- a/core/fxge/win32/cfx_psrenderer.h
+++ b/core/fxge/win32/cfx_psrenderer.h
@@ -21,7 +21,7 @@
class CFX_DIBBase;
class CFX_GlyphCache;
class CFX_Font;
-class CFX_PathData;
+class CFX_Path;
class CPSFont;
class TextCharPos;
struct CFX_FillRenderOptions;
@@ -63,14 +63,14 @@
void EndRendering();
void SaveState();
void RestoreState(bool bKeepSaved);
- void SetClip_PathFill(const CFX_PathData* pPathData,
+ void SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options);
- void SetClip_PathStroke(const CFX_PathData* pPathData,
+ void SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState);
FX_RECT GetClipBox() { return m_ClipBox; }
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -99,8 +99,7 @@
uint32_t color);
private:
- void OutputPath(const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device);
+ void OutputPath(const CFX_Path* pPath, const CFX_Matrix* pObject2Device);
void SetGraphState(const CFX_GraphStateData* pGraphState);
void SetColor(uint32_t color);
void FindPSFontGlyph(CFX_GlyphCache* pGlyphCache,
diff --git a/core/fxge/win32/cgdi_device_driver.cpp b/core/fxge/win32/cgdi_device_driver.cpp
index 0709f86..fe57ca8 100644
--- a/core/fxge/win32/cgdi_device_driver.cpp
+++ b/core/fxge/win32/cgdi_device_driver.cpp
@@ -14,7 +14,7 @@
#include "core/fxcrt/fx_string.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/render_defines.h"
#include "core/fxge/win32/cwin32_platform.h"
@@ -106,12 +106,10 @@
return CreateSolidBrush(ArgbToColorRef(argb));
}
-void SetPathToDC(HDC hDC,
- const CFX_PathData* pPathData,
- const CFX_Matrix* pMatrix) {
+void SetPathToDC(HDC hDC, const CFX_Path* pPath, const CFX_Matrix* pMatrix) {
BeginPath(hDC);
- pdfium::span<const FX_PATHPOINT> points = pPathData->GetPoints();
+ pdfium::span<const FX_PATHPOINT> points = pPath->GetPoints();
for (size_t i = 0; i < points.size(); ++i) {
CFX_PointF pos = points[i].m_Point;
if (pMatrix)
@@ -541,7 +539,7 @@
LineTo(m_hDC, FXSYS_roundf(x2), FXSYS_roundf(y2));
}
-bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
+bool CGdiDeviceDriver::DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pMatrix,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
@@ -555,7 +553,7 @@
static_cast<CWin32Platform*>(CFX_GEModule::Get()->GetPlatform());
if (!(pGraphState || stroke_color == 0) &&
!pPlatform->m_GdiplusExt.IsAvailable()) {
- CFX_FloatRect bbox_f = pPathData->GetBoundingBox();
+ CFX_FloatRect bbox_f = pPath->GetBoundingBox();
if (pMatrix)
bbox_f = pMatrix->TransformRect(bbox_f);
@@ -583,10 +581,10 @@
((m_DeviceType != DeviceType::kPrinter && !fill_options.full_cover) ||
(pGraphState && !pGraphState->m_DashArray.empty()))) {
if (!((!pMatrix || !pMatrix->WillScale()) && pGraphState &&
- pGraphState->m_LineWidth == 1.0f && pPathData->IsRect())) {
- if (pPlatform->m_GdiplusExt.DrawPath(m_hDC, pPathData, pMatrix,
- pGraphState, fill_color,
- stroke_color, fill_options)) {
+ pGraphState->m_LineWidth == 1.0f && pPath->IsRect())) {
+ if (pPlatform->m_GdiplusExt.DrawPath(m_hDC, pPath, pMatrix, pGraphState,
+ fill_color, stroke_color,
+ fill_options)) {
return true;
}
}
@@ -606,24 +604,24 @@
hBrush = CreateBrush(fill_color);
hBrush = (HBRUSH)SelectObject(m_hDC, hBrush);
}
- if (pPathData->GetPoints().size() == 2 && pGraphState &&
+ if (pPath->GetPoints().size() == 2 && pGraphState &&
!pGraphState->m_DashArray.empty()) {
- CFX_PointF pos1 = pPathData->GetPoint(0);
- CFX_PointF pos2 = pPathData->GetPoint(1);
+ CFX_PointF pos1 = pPath->GetPoint(0);
+ CFX_PointF pos2 = pPath->GetPoint(1);
if (pMatrix) {
pos1 = pMatrix->Transform(pos1);
pos2 = pMatrix->Transform(pos2);
}
DrawLine(pos1.x, pos1.y, pos2.x, pos2.y);
} else {
- SetPathToDC(m_hDC, pPathData, pMatrix);
+ SetPathToDC(m_hDC, pPath, pMatrix);
if (pGraphState && stroke_alpha) {
if (fill && fill_alpha) {
if (fill_options.text_mode) {
StrokeAndFillPath(m_hDC);
} else {
FillPath(m_hDC);
- SetPathToDC(m_hDC, pPathData, pMatrix);
+ SetPathToDC(m_hDC, pPath, pMatrix);
StrokePath(m_hDC);
}
} else {
@@ -671,10 +669,10 @@
}
bool CGdiDeviceDriver::SetClip_PathFill(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pMatrix,
const CFX_FillRenderOptions& fill_options) {
- Optional<CFX_FloatRect> maybe_rectf = pPathData->GetRect(pMatrix);
+ Optional<CFX_FloatRect> maybe_rectf = pPath->GetRect(pMatrix);
if (maybe_rectf.has_value()) {
FX_RECT rect = maybe_rectf.value().GetOuterRect();
// Can easily apply base clip to protect against wildly large rectangular
@@ -684,19 +682,19 @@
return IntersectClipRect(m_hDC, rect.left, rect.top, rect.right,
rect.bottom) != ERROR;
}
- SetPathToDC(m_hDC, pPathData, pMatrix);
+ SetPathToDC(m_hDC, pPath, pMatrix);
SetPolyFillMode(m_hDC, FillTypeToGdiFillType(fill_options.fill_type));
SelectClipPath(m_hDC, RGN_AND);
return true;
}
bool CGdiDeviceDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pMatrix,
const CFX_GraphStateData* pGraphState) {
HPEN hPen = CreateExtPen(pGraphState, pMatrix, 0xff000000);
hPen = (HPEN)SelectObject(m_hDC, hPen);
- SetPathToDC(m_hDC, pPathData, pMatrix);
+ SetPathToDC(m_hDC, pPath, pMatrix);
WidenPath(m_hDC);
SetPolyFillMode(m_hDC, WINDING);
bool ret = !!SelectClipPath(m_hDC, RGN_AND);
diff --git a/core/fxge/win32/cgdi_device_driver.h b/core/fxge/win32/cgdi_device_driver.h
index 34c7d4c..b672532 100644
--- a/core/fxge/win32/cgdi_device_driver.h
+++ b/core/fxge/win32/cgdi_device_driver.h
@@ -24,13 +24,13 @@
void SaveState() override;
void RestoreState(bool bKeepSaved) override;
void SetBaseClip(const FX_RECT& rect) override;
- bool SetClip_PathFill(const CFX_PathData* pPathData,
+ bool SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) override;
- bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ bool SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) override;
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/win32/cgdi_plus_ext.cpp b/core/fxge/win32/cgdi_plus_ext.cpp
index 69b7fb7..3bce828 100644
--- a/core/fxge/win32/cgdi_plus_ext.cpp
+++ b/core/fxge/win32/cgdi_plus_ext.cpp
@@ -22,7 +22,7 @@
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/win32/cwin32_platform.h"
#include "third_party/base/span.h"
@@ -669,13 +669,13 @@
}
bool CGdiplusExt::DrawPath(HDC hDC,
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_argb,
uint32_t stroke_argb,
const CFX_FillRenderOptions& fill_options) {
- pdfium::span<const FX_PATHPOINT> points = pPathData->GetPoints();
+ pdfium::span<const FX_PATHPOINT> points = pPath->GetPoints();
if (points.empty())
return true;
diff --git a/core/fxge/win32/cgdi_plus_ext.h b/core/fxge/win32/cgdi_plus_ext.h
index 9a495a9..bcb4358 100644
--- a/core/fxge/win32/cgdi_plus_ext.h
+++ b/core/fxge/win32/cgdi_plus_ext.h
@@ -17,7 +17,7 @@
class CFX_DIBitmap;
class CFX_GraphStateData;
class CFX_Matrix;
-class CFX_PathData;
+class CFX_Path;
struct CFX_FillRenderOptions;
struct FXDIB_ResampleOptions;
struct FX_RECT;
@@ -38,7 +38,7 @@
const FX_RECT* pClipRect,
const FXDIB_ResampleOptions& options);
bool DrawPath(HDC hDC,
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_argb,
diff --git a/core/fxge/win32/cps_printer_driver.cpp b/core/fxge/win32/cps_printer_driver.cpp
index 389bcb3..6fbe528 100644
--- a/core/fxge/win32/cps_printer_driver.cpp
+++ b/core/fxge/win32/cps_printer_driver.cpp
@@ -13,7 +13,7 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/win32/cpsoutput.h"
#include "third_party/base/check.h"
@@ -53,7 +53,7 @@
std::vector<uint8_t, FxAllocAllocator<uint8_t>> buffer(dwCount);
RGNDATA* pData = reinterpret_cast<RGNDATA*>(buffer.data());
if (::GetRegionData(hRgn, dwCount, pData)) {
- CFX_PathData path;
+ CFX_Path path;
for (uint32_t i = 0; i < pData->rdh.nCount; i++) {
RECT* pRect =
reinterpret_cast<RECT*>(pData->Buffer + pData->rdh.nRgnSize * i);
@@ -107,22 +107,22 @@
}
bool CPSPrinterDriver::SetClip_PathFill(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) {
- m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_options);
+ m_PSRenderer.SetClip_PathFill(pPath, pObject2Device, fill_options);
return true;
}
bool CPSPrinterDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
- m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState);
+ m_PSRenderer.SetClip_PathStroke(pPath, pObject2Device, pGraphState);
return true;
}
-bool CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData,
+bool CPSPrinterDriver::DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_ARGB fill_color,
@@ -131,8 +131,8 @@
BlendMode blend_type) {
if (blend_type != BlendMode::kNormal)
return false;
- return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState,
- fill_color, stroke_color, fill_options);
+ return m_PSRenderer.DrawPath(pPath, pObject2Device, pGraphState, fill_color,
+ stroke_color, fill_options);
}
bool CPSPrinterDriver::GetClipBox(FX_RECT* pRect) {
diff --git a/core/fxge/win32/cps_printer_driver.h b/core/fxge/win32/cps_printer_driver.h
index 229afab..a9588d6 100644
--- a/core/fxge/win32/cps_printer_driver.h
+++ b/core/fxge/win32/cps_printer_driver.h
@@ -28,13 +28,13 @@
int GetDeviceCaps(int caps_id) const override;
void SaveState() override;
void RestoreState(bool bKeepSaved) override;
- bool SetClip_PathFill(const CFX_PathData* pPathData,
+ bool SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) override;
- bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ bool SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) override;
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/win32/ctext_only_printer_driver.cpp b/core/fxge/win32/ctext_only_printer_driver.cpp
index b9746c5..9d8b65f 100644
--- a/core/fxge/win32/ctext_only_printer_driver.cpp
+++ b/core/fxge/win32/ctext_only_printer_driver.cpp
@@ -56,20 +56,20 @@
}
bool CTextOnlyPrinterDriver::SetClip_PathFill(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) {
return true;
}
bool CTextOnlyPrinterDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
+ const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) {
return false;
}
-bool CTextOnlyPrinterDriver::DrawPath(const CFX_PathData* pPathData,
+bool CTextOnlyPrinterDriver::DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/core/fxge/win32/ctext_only_printer_driver.h b/core/fxge/win32/ctext_only_printer_driver.h
index aaf0143..0d2eba0 100644
--- a/core/fxge/win32/ctext_only_printer_driver.h
+++ b/core/fxge/win32/ctext_only_printer_driver.h
@@ -22,13 +22,13 @@
int GetDeviceCaps(int caps_id) const override;
void SaveState() override {}
void RestoreState(bool bKeepSaved) override {}
- bool SetClip_PathFill(const CFX_PathData* pPathData,
+ bool SetClip_PathFill(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_FillRenderOptions& fill_options) override;
- bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ bool SetClip_PathStroke(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState) override;
- bool DrawPath(const CFX_PathData* pPathData,
+ bool DrawPath(const CFX_Path* pPath,
const CFX_Matrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
uint32_t fill_color,
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index 2eeab6c..90e8fe8 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -24,7 +24,7 @@
#include "core/fpdfdoc/cpdf_interactiveform.h"
#include "core/fxcrt/autorestorer.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "fpdfsdk/cpdfsdk_actionhandler.h"
#include "fpdfsdk/cpdfsdk_annot.h"
#include "fpdfsdk/cpdfsdk_annotiterator.h"
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 118737f..ed2c13d 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -26,7 +26,7 @@
#include "core/fpdfdoc/cpdf_interactiveform.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/cpdfsdk_actionhandler.h"
#include "fpdfsdk/cpdfsdk_appstream.h"
@@ -676,9 +676,9 @@
CFX_GraphStateData gsd;
gsd.m_LineWidth = 0.0f;
- CFX_PathData pathData;
- pathData.AppendFloatRect(GetRect());
- pDevice->DrawPath(&pathData, &mtUser2Device, &gsd, 0, 0xFFAAAAAA,
+ CFX_Path path;
+ path.AppendFloatRect(GetRect());
+ pDevice->DrawPath(&path, &mtUser2Device, &gsd, 0, 0xFFAAAAAA,
CFX_FillRenderOptions::EvenOddOptions());
} else {
CPDFSDK_BAAnnot::DrawAppearance(pDevice, mtUser2Device, mode, pOptions);
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 37bd2ad..1ee16ff 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -22,7 +22,7 @@
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -64,11 +64,11 @@
}
void OutputPath(std::ostringstream& buf, CPDF_Path path) {
- const CFX_PathData* pPathData = path.GetObject();
- if (!pPathData)
+ const CFX_Path* pPath = path.GetObject();
+ if (!pPath)
return;
- pdfium::span<const FX_PATHPOINT> points = pPathData->GetPoints();
+ pdfium::span<const FX_PATHPOINT> points = pPath->GetPoints();
if (path.IsRect()) {
CFX_PointF diff = points[2].m_Point - points[0].m_Point;
buf << points[0].m_Point.x << " " << points[0].m_Point.y << " " << diff.x
diff --git a/fpdfsdk/pwl/cpwl_caret.cpp b/fpdfsdk/pwl/cpwl_caret.cpp
index 50eafe9..cf5e726 100644
--- a/fpdfsdk/pwl/cpwl_caret.cpp
+++ b/fpdfsdk/pwl/cpwl_caret.cpp
@@ -11,7 +11,7 @@
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
CPWL_Caret::CPWL_Caret(
@@ -28,7 +28,6 @@
CFX_FloatRect rcRect = GetCaretRect();
CFX_FloatRect rcClip = GetClipRect();
- CFX_PathData path;
float fCaretX = rcRect.left + m_fWidth * 0.5f;
float fCaretTop = rcRect.top;
@@ -42,6 +41,7 @@
fCaretBottom = rcRect.bottom;
}
+ CFX_Path path;
path.AppendPoint(CFX_PointF(fCaretX, fCaretBottom), FXPT_TYPE::MoveTo);
path.AppendPoint(CFX_PointF(fCaretX, fCaretTop), FXPT_TYPE::LineTo);
diff --git a/fpdfsdk/pwl/cpwl_cbbutton.cpp b/fpdfsdk/pwl/cpwl_cbbutton.cpp
index bb4725f..47ed807 100644
--- a/fpdfsdk/pwl/cpwl_cbbutton.cpp
+++ b/fpdfsdk/pwl/cpwl_cbbutton.cpp
@@ -9,7 +9,7 @@
#include <utility>
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
CPWL_CBButton::CPWL_CBButton(
@@ -45,7 +45,7 @@
ptCenter.y + kComboBoxTriangleQuarterLength);
CFX_PointF pt3(ptCenter.x, ptCenter.y - kComboBoxTriangleQuarterLength);
- CFX_PathData path;
+ CFX_Path path;
path.AppendPoint(pt1, FXPT_TYPE::MoveTo);
path.AppendPoint(pt2, FXPT_TYPE::LineTo);
path.AppendPoint(pt3, FXPT_TYPE::LineTo);
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index 08f958f..24f3de1 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -17,7 +17,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/fx_font.h"
#include "fpdfsdk/pwl/cpwl_caret.h"
@@ -187,7 +187,7 @@
}
const float width = (rcClient.right - rcClient.left) / nCharArray;
- CFX_PathData path;
+ CFX_Path path;
CFX_PointF bottom(0, rcClient.bottom);
CFX_PointF top(0, rcClient.top);
for (int32_t i = 0; i < nCharArray - 1; ++i) {
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 2bb29c7..705678e 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -20,7 +20,7 @@
#include "core/fxcrt/fx_codepage.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/pwl/cpwl_edit.h"
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
@@ -643,7 +643,7 @@
rc.Intersect(rcClip);
pSystemHandler->OutputSelectedRect(pFFLData, rc);
} else {
- CFX_PathData pathSelBK;
+ CFX_Path pathSelBK;
pathSelBK.AppendRect(word.ptWord.x, line.ptLine.y + line.fLineDescent,
word.ptWord.x + word.fWidth,
line.ptLine.y + line.fLineAscent);
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
index fe78fcd..1a14224 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -11,7 +11,7 @@
#include <utility>
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/pwl/cpwl_wnd.h"
#include "third_party/base/check.h"
diff --git a/fxbarcode/BC_TwoDimWriter.cpp b/fxbarcode/BC_TwoDimWriter.cpp
index a53162b..c3647d9 100644
--- a/fxbarcode/BC_TwoDimWriter.cpp
+++ b/fxbarcode/BC_TwoDimWriter.cpp
@@ -11,7 +11,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "fxbarcode/BC_Writer.h"
#include "fxbarcode/common/BC_CommonBitMatrix.h"
@@ -89,7 +89,7 @@
DCHECK(m_output);
CFX_GraphStateData stateData;
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(0, 0, m_Width, m_Height);
device->DrawPath(&path, &matrix, &stateData, kBackgroundColor,
kBackgroundColor, CFX_FillRenderOptions::EvenOddOptions());
@@ -116,7 +116,7 @@
int start_y_output = y + 1;
int end_y_output = y + 2;
- CFX_PathData rect;
+ CFX_Path rect;
rect.AppendRect(leftPos + start_x_output * m_multiX,
topPos + start_y_output * m_multiY,
leftPos + end_x_output * m_multiX,
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index 3ddeea6..43c6876 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -31,7 +31,7 @@
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_font.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_unicodeencodingex.h"
#include "core/fxge/text_char_pos.h"
@@ -249,7 +249,7 @@
return false;
CFX_GraphStateData stateData;
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(0, 0, static_cast<float>(m_Width),
static_cast<float>(m_Height));
device->DrawPath(&path, &matrix, &stateData, kBackgroundColor,
diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h
index 0451f27..682e3fc 100644
--- a/fxbarcode/oned/BC_OneDimWriter.h
+++ b/fxbarcode/oned/BC_OneDimWriter.h
@@ -18,7 +18,7 @@
#include "fxbarcode/utils.h"
class CFX_Font;
-class CFX_PathData;
+class CFX_Path;
class CFX_RenderDevice;
class TextCharPos;
@@ -102,7 +102,7 @@
int32_t m_iDataLenth = 0;
size_t m_iContentLen = 0;
- std::vector<CFX_PathData> m_output;
+ std::vector<CFX_Path> m_output;
int32_t m_barWidth;
int32_t m_multiple;
float m_outputHScale;
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 2db3d76..78c7f80 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -14,7 +14,7 @@
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_font.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/cfx_textrenderoptions.h"
diff --git a/xfa/fgas/graphics/cfgas_gegraphics.cpp b/xfa/fgas/graphics/cfgas_gegraphics.cpp
index 77480b4..b9721ed 100644
--- a/xfa/fgas/graphics/cfgas_gegraphics.cpp
+++ b/xfa/fgas/graphics/cfgas_gegraphics.cpp
@@ -207,7 +207,7 @@
CFX_Matrix m = m_info.CTM;
m.Concat(matrix);
- m_renderDevice->DrawPath(path.GetPathData(), &m, &m_info.graphState, 0x0,
+ m_renderDevice->DrawPath(path.GetPath(), &m, &m_info.graphState, 0x0,
m_info.strokeColor.GetArgb(),
CFX_FillRenderOptions());
}
@@ -222,7 +222,7 @@
const CFX_FillRenderOptions fill_options(fill_type);
switch (m_info.fillColor.GetType()) {
case CFGAS_GEColor::Solid:
- m_renderDevice->DrawPath(path.GetPathData(), &m, &m_info.graphState,
+ m_renderDevice->DrawPath(path.GetPath(), &m, &m_info.graphState,
m_info.fillColor.GetArgb(), 0x0, fill_options);
return;
case CFGAS_GEColor::Pattern:
@@ -256,7 +256,7 @@
mask->Create(data.width, data.height, FXDIB_Format::k1bppMask);
memcpy(mask->GetBuffer(), data.maskBits, mask->GetPitch() * data.height);
const CFX_FloatRect rectf =
- matrix.TransformRect(path.GetPathData()->GetBoundingBox());
+ matrix.TransformRect(path.GetPath()->GetBoundingBox());
const FX_RECT rect = rectf.ToRoundedFxRect();
CFX_DefaultRenderDevice device;
@@ -269,7 +269,7 @@
}
}
CFX_RenderDevice::StateRestorer restorer(m_renderDevice);
- m_renderDevice->SetClip_PathFill(path.GetPathData(), &matrix, fill_options);
+ m_renderDevice->SetClip_PathFill(path.GetPath(), &matrix, fill_options);
SetDIBitsWithMatrix(bmp, CFX_Matrix());
}
@@ -389,7 +389,7 @@
}
if (result) {
CFX_RenderDevice::StateRestorer restorer(m_renderDevice);
- m_renderDevice->SetClip_PathFill(path.GetPathData(), &matrix, fill_options);
+ m_renderDevice->SetClip_PathFill(path.GetPath(), &matrix, fill_options);
SetDIBitsWithMatrix(bmp, matrix);
}
}
diff --git a/xfa/fgas/graphics/cfgas_gepath.cpp b/xfa/fgas/graphics/cfgas_gepath.cpp
index 29cef15..81c70f9 100644
--- a/xfa/fgas/graphics/cfgas_gepath.cpp
+++ b/xfa/fgas/graphics/cfgas_gepath.cpp
@@ -6,34 +6,34 @@
#include "xfa/fgas/graphics/cfgas_gepath.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
CFGAS_GEPath::CFGAS_GEPath() = default;
CFGAS_GEPath::~CFGAS_GEPath() = default;
void CFGAS_GEPath::Clear() {
- data_.Clear();
+ path_.Clear();
}
void CFGAS_GEPath::Close() {
- data_.ClosePath();
+ path_.ClosePath();
}
void CFGAS_GEPath::MoveTo(const CFX_PointF& point) {
- data_.AppendPoint(point, FXPT_TYPE::MoveTo);
+ path_.AppendPoint(point, FXPT_TYPE::MoveTo);
}
void CFGAS_GEPath::LineTo(const CFX_PointF& point) {
- data_.AppendPoint(point, FXPT_TYPE::LineTo);
+ path_.AppendPoint(point, FXPT_TYPE::LineTo);
}
void CFGAS_GEPath::BezierTo(const CFX_PointF& c1,
const CFX_PointF& c2,
const CFX_PointF& to) {
- data_.AppendPoint(c1, FXPT_TYPE::BezierTo);
- data_.AppendPoint(c2, FXPT_TYPE::BezierTo);
- data_.AppendPoint(to, FXPT_TYPE::BezierTo);
+ path_.AppendPoint(c1, FXPT_TYPE::BezierTo);
+ path_.AppendPoint(c2, FXPT_TYPE::BezierTo);
+ path_.AppendPoint(to, FXPT_TYPE::BezierTo);
}
void CFGAS_GEPath::ArcTo(const CFX_PointF& pos,
@@ -61,27 +61,27 @@
CFX_PointF bezier;
bezier.x = pos.x + (size.width * ((points[0].x * cs) - (points[0].y * sn)));
bezier.y = pos.y + (size.height * ((points[0].x * sn) + (points[0].y * cs)));
- data_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
+ path_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
bezier.x = pos.x + (size.width * ((points[1].x * cs) - (points[1].y * sn)));
bezier.y = pos.y + (size.height * ((points[1].x * sn) + (points[1].y * cs)));
- data_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
+ path_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
bezier.x = pos.x + (size.width * cos(start_angle + sweep_angle));
bezier.y = pos.y + (size.height * sin(start_angle + sweep_angle));
- data_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
+ path_.AppendPoint(bezier, FXPT_TYPE::BezierTo);
}
void CFGAS_GEPath::AddLine(const CFX_PointF& p1, const CFX_PointF& p2) {
- data_.AppendPoint(p1, FXPT_TYPE::MoveTo);
- data_.AppendPoint(p2, FXPT_TYPE::LineTo);
+ path_.AppendPoint(p1, FXPT_TYPE::MoveTo);
+ path_.AppendPoint(p2, FXPT_TYPE::LineTo);
}
void CFGAS_GEPath::AddRectangle(float left,
float top,
float width,
float height) {
- data_.AppendRect(left, top, left + width, top + height);
+ path_.AppendRect(left, top, left + width, top + height);
}
void CFGAS_GEPath::AddEllipse(const CFX_RectF& rect) {
@@ -107,7 +107,7 @@
CFX_SizeF size = original_size / 2;
CFX_PointF pos(original_pos.x + size.width, original_pos.y + size.height);
- data_.AppendPoint(pos + CFX_PointF(size.width * cos(start_angle),
+ path_.AppendPoint(pos + CFX_PointF(size.width * cos(start_angle),
size.height * sin(start_angle)),
FXPT_TYPE::MoveTo);
@@ -140,9 +140,9 @@
}
void CFGAS_GEPath::AddSubpath(const CFGAS_GEPath& path) {
- data_.Append(path.data_, nullptr);
+ path_.Append(path.path_, nullptr);
}
void CFGAS_GEPath::TransformBy(const CFX_Matrix& mt) {
- data_.Transform(mt);
+ path_.Transform(mt);
}
diff --git a/xfa/fgas/graphics/cfgas_gepath.h b/xfa/fgas/graphics/cfgas_gepath.h
index 7196e61..aefecfd 100644
--- a/xfa/fgas/graphics/cfgas_gepath.h
+++ b/xfa/fgas/graphics/cfgas_gepath.h
@@ -8,7 +8,7 @@
#define XFA_FGAS_GRAPHICS_CFGAS_GEPATH_H_
#include "core/fxcrt/fx_system.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "xfa/fgas/graphics/cfgas_gegraphics.h"
class CFGAS_GEPath final {
@@ -16,10 +16,10 @@
CFGAS_GEPath();
~CFGAS_GEPath();
- const CFX_PathData* GetPathData() const { return &data_; }
+ const CFX_Path* GetPath() const { return &path_; }
void Clear();
- bool IsEmpty() const { return data_.GetPoints().empty(); }
+ bool IsEmpty() const { return path_.GetPoints().empty(); }
void TransformBy(const CFX_Matrix& mt);
void Close();
@@ -49,7 +49,7 @@
float start_angle,
float sweep_angle);
- CFX_PathData data_;
+ CFX_Path path_;
};
#endif // XFA_FGAS_GRAPHICS_CFGAS_GEPATH_H_
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 1b9ffaa..a19927e 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -6,7 +6,7 @@
#include "xfa/fwl/theme/cfwl_checkboxtp.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "third_party/base/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fgas/graphics/cfgas_gecolor.h"
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 292dfcf..961921c 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -15,7 +15,7 @@
#include "core/fxcodec/progressive_decoder.h"
#include "core/fxcrt/maybe_owned.h"
#include "core/fxge/cfx_fillrenderoptions.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "third_party/base/check.h"
@@ -135,7 +135,7 @@
CFX_RenderDevice* pRenderDevice = pGS->GetRenderDevice();
CFX_RenderDevice::StateRestorer restorer(pRenderDevice);
- CFX_PathData path;
+ CFX_Path path;
path.AppendRect(rtImage.left, rtImage.bottom(), rtImage.right(), rtImage.top);
pRenderDevice->SetClip_PathFill(&path, &matrix,
CFX_FillRenderOptions::WindingOptions());
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index 71e638a..2670f6e 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -16,7 +16,7 @@
#include "core/fxcrt/xml/cfx_xmltext.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/text_char_pos.h"
#include "fxjs/xfa/cjx_object.h"
@@ -1174,7 +1174,7 @@
if (bNoUnderline && bNoLineThrough)
return;
- CFX_PathData path;
+ CFX_Path path;
size_t szChars = GetDisplayPos(pPiece, pCharPos);
if (szChars > 0) {
CFX_PointF pt1;