Removes _SKIA_SUPPORT_PATHS_ macro
Mechanically replaces conditions on the _SKIA_SUPPORT_ and
_SKIA_SUPPORT_PATHS_ macros to just reference _SKIA_SUPPORT_.
Also simplifies pdfium_test.cc by removing PDF_ENABLE_SKIA_PATHS, and
using a capturing lambda to simplify ShowConfig().
Bug: pdfium:1941
Change-Id: I35c546cc20e1cf52437379002463fa2f5aa32e2e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/101853
Auto-Submit: K. Moon <kmoon@chromium.org>
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 86520a5..a853212 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -40,10 +40,6 @@
defines += [ "_SKIA_SUPPORT_" ]
}
- if (pdf_use_skia_paths) {
- defines += [ "_SKIA_SUPPORT_PATHS_" ]
- }
-
if (is_win) {
# Assume UTF-8 by default to avoid code page dependencies.
cflags += [ "/utf-8" ]
diff --git a/core/fpdfapi/page/cpdf_expintfunc.h b/core/fpdfapi/page/cpdf_expintfunc.h
index c794b85..803b2ef 100644
--- a/core/fpdfapi/page/cpdf_expintfunc.h
+++ b/core/fpdfapi/page/cpdf_expintfunc.h
@@ -12,7 +12,7 @@
#include "core/fpdfapi/page/cpdf_function.h"
#include "core/fxcrt/data_vector.h"
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#include "third_party/base/span.h"
#endif
@@ -29,7 +29,7 @@
uint32_t GetOrigOutputs() const { return m_nOrigOutputs; }
float GetExponent() const { return m_Exponent; }
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
pdfium::span<const float> GetBeginValues() const { return m_BeginValues; }
pdfium::span<const float> GetEndValues() const { return m_EndValues; }
#endif
diff --git a/core/fpdfapi/page/cpdf_function.cpp b/core/fpdfapi/page/cpdf_function.cpp
index f27ded9..95e4b7e 100644
--- a/core/fpdfapi/page/cpdf_function.cpp
+++ b/core/fpdfapi/page/cpdf_function.cpp
@@ -170,7 +170,7 @@
return ymin + (divisor ? (x - xmin) * (ymax - ymin) / divisor : 0);
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
const CPDF_SampledFunc* CPDF_Function::ToSampledFunc() const {
return m_Type == Type::kType0Sampled
? static_cast<const CPDF_SampledFunc*>(this)
@@ -188,4 +188,4 @@
? static_cast<const CPDF_StitchFunc*>(this)
: nullptr;
}
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
diff --git a/core/fpdfapi/page/cpdf_function.h b/core/fpdfapi/page/cpdf_function.h
index 99d6d32..0306fd9 100644
--- a/core/fpdfapi/page/cpdf_function.h
+++ b/core/fpdfapi/page/cpdf_function.h
@@ -48,11 +48,11 @@
float ymin,
float ymax) const;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
const CPDF_SampledFunc* ToSampledFunc() const;
const CPDF_ExpIntFunc* ToExpIntFunc() const;
const CPDF_StitchFunc* ToStitchFunc() const;
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
protected:
explicit CPDF_Function(Type type);
diff --git a/core/fpdfapi/page/cpdf_sampledfunc.cpp b/core/fpdfapi/page/cpdf_sampledfunc.cpp
index 8ea3e10..221e4a4 100644
--- a/core/fpdfapi/page/cpdf_sampledfunc.cpp
+++ b/core/fpdfapi/page/cpdf_sampledfunc.cpp
@@ -176,7 +176,7 @@
return true;
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
RetainPtr<CPDF_StreamAcc> CPDF_SampledFunc::GetSampleStream() const {
return m_pSampleStream;
}
diff --git a/core/fpdfapi/page/cpdf_sampledfunc.h b/core/fpdfapi/page/cpdf_sampledfunc.h
index 8ca7adb..ccf3cfc 100644
--- a/core/fpdfapi/page/cpdf_sampledfunc.h
+++ b/core/fpdfapi/page/cpdf_sampledfunc.h
@@ -41,7 +41,7 @@
}
uint32_t GetBitsPerSample() const { return m_nBitsPerSample; }
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
RetainPtr<CPDF_StreamAcc> GetSampleStream() const;
#endif
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 6f9e49e..6b7d484 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -161,7 +161,7 @@
return pChar && (!pChar->colored() || MissingStrokeColor(pColorState));
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
class ScopedSkiaDeviceFlush {
public:
FX_STACK_ALLOCATED();
@@ -715,12 +715,12 @@
bitmap_render.SetFormResource(std::move(pFormResource));
bitmap_render.Initialize(nullptr, nullptr);
bitmap_render.ProcessObjectNoClip(pPageObj, new_matrix);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer()) {
bitmap_device.Flush(true);
bitmap->UnPreMultiply();
}
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
m_bStopped = bitmap_render.m_bStopped;
if (pSMaskDict) {
CFX_Matrix smask_matrix =
@@ -1194,7 +1194,7 @@
return;
CFX_RenderDevice::StateRestorer restorer(m_pDevice);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
ScopedSkiaDeviceFlush scoped_skia_device_flush(m_pDevice);
#endif
if (!ClipPattern(pPageObj, mtObj2Device, stroke))
diff --git a/core/fxge/cfx_defaultrenderdevice.cpp b/core/fxge/cfx_defaultrenderdevice.cpp
index 1a344c3..912db62 100644
--- a/core/fxge/cfx_defaultrenderdevice.cpp
+++ b/core/fxge/cfx_defaultrenderdevice.cpp
@@ -38,7 +38,7 @@
CFX_DefaultRenderDevice::CFX_DefaultRenderDevice() = default;
CFX_DefaultRenderDevice::~CFX_DefaultRenderDevice() {
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (SkiaIsDefaultRenderer())
Flush(true);
#endif
@@ -67,7 +67,7 @@
bool bRgbByteOrder,
RetainPtr<CFX_DIBitmap> pBackdropBitmap,
bool bGroupKnockout) {
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (SkiaIsDefaultRenderer()) {
return AttachSkiaImpl(pBitmap, bRgbByteOrder, pBackdropBitmap,
bGroupKnockout);
@@ -80,7 +80,7 @@
int height,
FXDIB_Format format,
RetainPtr<CFX_DIBitmap> pBackdropBitmap) {
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (SkiaIsDefaultRenderer())
return CreateSkia(width, height, format, pBackdropBitmap);
#endif
diff --git a/core/fxge/cfx_defaultrenderdevice.h b/core/fxge/cfx_defaultrenderdevice.h
index 8d93b89..6af477d 100644
--- a/core/fxge/cfx_defaultrenderdevice.h
+++ b/core/fxge/cfx_defaultrenderdevice.h
@@ -79,7 +79,7 @@
FXDIB_Format format,
RetainPtr<CFX_DIBitmap> pBackdropBitmap);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
bool AttachSkiaImpl(RetainPtr<CFX_DIBitmap> pBitmap,
bool bRgbByteOrder,
RetainPtr<CFX_DIBitmap> pBackdropBitmap,
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index 2224971..04f3d38 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -543,7 +543,7 @@
return m_Face && FXFT_Is_Face_fixedwidth(m_Face->GetRec()) != 0;
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
bool CFX_Font::IsSubstFontBold() const {
CFX_SubstFont* subst_font = GetSubstFont();
return subst_font && subst_font->GetOriginalWeight() >= FXFONT_FW_BOLD;
@@ -790,7 +790,7 @@
return kAngleSkew[-angle];
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
CFX_TypeFace* CFX_Font::GetDeviceCache() const {
return GetOrCreateGlyphCache()->GetDeviceCache(this);
}
diff --git a/core/fxge/cfx_font.h b/core/fxge/cfx_font.h
index dea2122..1a25d63 100644
--- a/core/fxge/cfx_font.h
+++ b/core/fxge/cfx_font.h
@@ -23,7 +23,7 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/base/span.h"
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#include "core/fxge/fx_font.h"
#endif
@@ -138,7 +138,7 @@
std::unique_ptr<CFX_Path> LoadGlyphPathImpl(uint32_t glyph_index,
int dest_width) const;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
CFX_TypeFace* GetDeviceCache() const;
bool IsSubstFontBold() const;
#endif
diff --git a/core/fxge/cfx_glyphcache.cpp b/core/fxge/cfx_glyphcache.cpp
index 36df2db..1227be1 100644
--- a/core/fxge/cfx_glyphcache.cpp
+++ b/core/fxge/cfx_glyphcache.cpp
@@ -27,7 +27,7 @@
#include "core/fxge/scoped_font_transform.h"
#include "third_party/base/numerics/safe_math.h"
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#include "third_party/skia/include/core/SkStream.h" // nogncheck
#include "third_party/skia/include/core/SkTypeface.h" // nogncheck
@@ -312,7 +312,7 @@
#endif // BUILDFLAG(IS_APPLE)
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
CFX_TypeFace* CFX_GlyphCache::GetDeviceCache(const CFX_Font* pFont) {
if (!m_pTypeface) {
pdfium::span<const uint8_t> span = pFont->GetFontSpan();
@@ -329,7 +329,7 @@
#endif // BUILDFLAG(IS_WIN)
return m_pTypeface.get();
}
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
#if !BUILDFLAG(IS_APPLE)
void CFX_GlyphCache::InitPlatform() {}
diff --git a/core/fxge/cfx_glyphcache.h b/core/fxge/cfx_glyphcache.h
index ff3cbb9..cb66c76 100644
--- a/core/fxge/cfx_glyphcache.h
+++ b/core/fxge/cfx_glyphcache.h
@@ -16,7 +16,7 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxge/cfx_face.h"
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#include "core/fxge/fx_font.h"
#include "third_party/skia/include/core/SkTypeface.h" // nogncheck
#endif
@@ -46,7 +46,7 @@
RetainPtr<CFX_Face> GetFace() { return m_Face; }
FXFT_FaceRec* GetFaceRec() { return m_Face ? m_Face->GetRec() : nullptr; }
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont);
#endif
@@ -82,7 +82,7 @@
RetainPtr<CFX_Face> const m_Face;
std::map<ByteString, SizeGlyphCache> m_SizeMap;
std::map<PathMapKey, std::unique_ptr<CFX_Path>> m_PathMap;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
sk_sp<SkTypeface> m_pTypeface;
#endif
};
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 17f872c..fa61c9d 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -36,7 +36,7 @@
#include "third_party/base/notreached.h"
#include "third_party/base/span.h"
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#include "third_party/skia/include/core/SkTypes.h" // nogncheck
#endif
@@ -487,7 +487,7 @@
CFX_RenderDevice::~CFX_RenderDevice() {
RestoreState(false);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer())
Flush(true);
#endif
@@ -501,7 +501,7 @@
return CFX_Matrix(width, 0, 0, -height, left, top + height);
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
void CFX_RenderDevice::Flush(bool release) {
if (release)
m_pDeviceDriver.reset();
@@ -802,7 +802,7 @@
fill_options, blend_type)) {
return false;
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer())
bitmap_device.GetDeviceDriver()->Flush();
#endif
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 9557afe..909cbb2 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -217,7 +217,7 @@
int bitmap_alpha,
BlendMode blend_type);
#endif
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
void Flush(bool release);
#endif
diff --git a/core/fxge/cfx_substfont.cpp b/core/fxge/cfx_substfont.cpp
index 9cb849b..d2820cd 100644
--- a/core/fxge/cfx_substfont.cpp
+++ b/core/fxge/cfx_substfont.cpp
@@ -10,7 +10,7 @@
CFX_SubstFont::~CFX_SubstFont() = default;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
int CFX_SubstFont::GetOriginalWeight() const {
int weight = m_Weight;
diff --git a/core/fxge/cfx_substfont.h b/core/fxge/cfx_substfont.h
index ea86555..0b33197 100644
--- a/core/fxge/cfx_substfont.h
+++ b/core/fxge/cfx_substfont.h
@@ -15,7 +15,7 @@
CFX_SubstFont();
~CFX_SubstFont();
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
int GetOriginalWeight() const;
#endif
void UseChromeSerif();
diff --git a/core/fxge/dib/cfx_dibbase.h b/core/fxge/dib/cfx_dibbase.h
index 8030be2..52a56ac 100644
--- a/core/fxge/dib/cfx_dibbase.h
+++ b/core/fxge/dib/cfx_dibbase.h
@@ -97,7 +97,7 @@
int& src_top,
const CFX_ClipRgn* pClipRgn) const;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
void DebugVerifyBufferIsPreMultiplied(void* buffer) const;
#endif
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 74696a6..375fd6c 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -528,7 +528,7 @@
return true;
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
uint32_t CFX_DIBitmap::GetPixel(int x, int y) const {
if (!m_pBuffer)
return 0;
@@ -568,7 +568,7 @@
}
return 0;
}
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
#if defined(_SKIA_SUPPORT_)
void CFX_DIBitmap::SetPixel(int x, int y, uint32_t color) {
diff --git a/core/fxge/dib/cfx_dibitmap.h b/core/fxge/dib/cfx_dibitmap.h
index 508cf89..fb7ba95 100644
--- a/core/fxge/dib/cfx_dibitmap.h
+++ b/core/fxge/dib/cfx_dibitmap.h
@@ -41,7 +41,7 @@
bool ConvertFormat(FXDIB_Format format);
void Clear(uint32_t color);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
uint32_t GetPixel(int x, int y) const;
#endif
#if defined(_SKIA_SUPPORT_)
@@ -106,7 +106,7 @@
FXDIB_Format format,
uint32_t pitch);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
void PreMultiply();
void DebugVerifyBitmapIsPreMultiplied() const;
void UnPreMultiply();
@@ -115,7 +115,7 @@
private:
enum class Channel : uint8_t { kRed, kAlpha };
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
enum class Format { kCleared, kPreMultiplied, kUnPreMultiplied };
#endif
@@ -150,7 +150,7 @@
int src_top);
MaybeOwned<uint8_t, FxFreeDeleter> m_pBuffer;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
Format m_nFormat = Format::kCleared;
#endif
};
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h
index 82ba090..059d864 100644
--- a/core/fxge/fx_font.h
+++ b/core/fxge/fx_font.h
@@ -43,7 +43,7 @@
constexpr uint16_t kNamePlatformMac = 1;
constexpr uint16_t kNamePlatformWindows = 3;
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
class SkTypeface;
using CFX_TypeFace = SkTypeface;
diff --git a/core/fxge/renderdevicedriver_iface.cpp b/core/fxge/renderdevicedriver_iface.cpp
index 222e93a..26911a6 100644
--- a/core/fxge/renderdevicedriver_iface.cpp
+++ b/core/fxge/renderdevicedriver_iface.cpp
@@ -85,6 +85,6 @@
void RenderDeviceDriverIface::SetGroupKnockout(bool group_knockout) {}
#endif
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
void RenderDeviceDriverIface::Flush() {}
#endif
diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h
index 0aa4330..c22fe54 100644
--- a/core/fxge/renderdevicedriver_iface.h
+++ b/core/fxge/renderdevicedriver_iface.h
@@ -117,7 +117,7 @@
BlendMode blend_type);
virtual void SetGroupKnockout(bool group_knockout);
#endif
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
virtual void Flush();
#endif
};
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index 7657992..e5ad3d9 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -70,12 +70,12 @@
size_y, rotate, flags, color_scheme,
/*need_to_restore=*/false, &pause_adapter);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer()) {
pDevice->Flush(false);
pBitmap->UnPreMultiply();
}
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
if (!pContext->m_pRenderer)
return FPDF_RENDER_FAILED;
@@ -114,13 +114,13 @@
CPDFSDK_PauseAdapter pause_adapter(pause);
pContext->m_pRenderer->Continue(&pause_adapter);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer()) {
CFX_RenderDevice* pDevice = pContext->m_pDevice.get();
pDevice->Flush(false);
pDevice->GetBitmap()->UnPreMultiply();
}
-#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#endif // _SKIA_SUPPORT_
return ToFPDFStatus(pContext->m_pRenderer->GetStatus());
}
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index da8c75a..a93cf95 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -135,8 +135,7 @@
}
CHECK(false);
#else
- // `FPDF_RENDERERTYPE_AGG` is used for fully AGG builds as well as for the
- // _SKIA_SUPPORT_PATHS_ build configuration.
+ // `FPDF_RENDERERTYPE_AGG` is used for fully AGG builds.
CHECK_EQ(public_type, FPDF_RENDERERTYPE_AGG);
#endif
}
@@ -681,7 +680,7 @@
/*need_to_restore=*/true,
/*pause=*/nullptr);
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer()) {
pDevice->Flush(true);
pBitmap->UnPreMultiply();
diff --git a/fxbarcode/cfx_barcode_unittest.cpp b/fxbarcode/cfx_barcode_unittest.cpp
index 41a3cd8..24b860e 100644
--- a/fxbarcode/cfx_barcode_unittest.cpp
+++ b/fxbarcode/cfx_barcode_unittest.cpp
@@ -65,7 +65,7 @@
};
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Code39 DISABLED_Code39
#else
#define MAYBE_Code39 Code39
@@ -78,7 +78,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_CodaBar DISABLED_CodaBar
#else
#define MAYBE_CodaBar CodaBar
@@ -96,7 +96,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Code128 DISABLED_Code128
#else
#define MAYBE_Code128 Code128
@@ -109,7 +109,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Code128B DISABLED_Code128B
#else
#define MAYBE_Code128B Code128B
@@ -122,7 +122,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Code128C DISABLED_Code128C
#else
#define MAYBE_Code128C Code128C
@@ -135,7 +135,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Code128CLetters DISABLED_Code128CLetters
#else
#define MAYBE_Code128CLetters Code128CLetters
@@ -148,7 +148,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Ean8 DISABLED_Ean8
#else
#define MAYBE_Ean8 Ean8
@@ -166,7 +166,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_UPCA DISABLED_UPCA
#else
#define MAYBE_UPCA UPCA
@@ -184,7 +184,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Ean13 DISABLED_Ean13
#else
#define MAYBE_Ean13 Ean13
@@ -202,7 +202,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_Pdf417 DISABLED_Pdf417
#else
#define MAYBE_Pdf417 Pdf417
@@ -215,7 +215,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_DataMatrix DISABLED_DataMatrix
#else
#define MAYBE_DataMatrix DataMatrix
@@ -228,7 +228,7 @@
}
// https://crbug.com/pdfium/738
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#define MAYBE_QrCode DISABLED_QrCode
#else
#define MAYBE_QrCode QrCode
diff --git a/samples/BUILD.gn b/samples/BUILD.gn
index 4a59acf..46be506 100644
--- a/samples/BUILD.gn
+++ b/samples/BUILD.gn
@@ -17,8 +17,6 @@
include_dirs = [ ".." ]
if (pdf_use_skia) {
defines += [ "PDF_ENABLE_SKIA" ]
- } else if (pdf_use_skia_paths) {
- defines += [ "PDF_ENABLE_SKIA_PATHS" ]
}
if (is_asan) {
defines += [ "PDF_ENABLE_ASAN" ]
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 42f33ec..c7dbe8d 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -19,10 +19,6 @@
#define _SKIA_SUPPORT_
#endif
-#if defined(PDF_ENABLE_SKIA_PATHS) && !defined(_SKIA_SUPPORT_PATHS_)
-#define _SKIA_SUPPORT_PATHS_
-#endif
-
#include "public/cpp/fpdf_scopers.h"
#include "public/fpdf_annot.h"
#include "public/fpdf_attachment.h"
@@ -1323,35 +1319,26 @@
void ShowConfig() {
std::string config;
- std::string maybe_comma;
+ [[maybe_unused]] auto append_config = [&config](const char* name) {
+ if (!config.empty())
+ config += ',';
+ config += name;
+ };
+
#ifdef PDF_ENABLE_V8
- config.append(maybe_comma);
- config.append("V8");
- maybe_comma = ",";
-#endif // PDF_ENABLE_V8
+ append_config("V8");
+#endif
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
- config.append(maybe_comma);
- config.append("V8_EXTERNAL");
- maybe_comma = ",";
-#endif // V8_USE_EXTERNAL_STARTUP_DATA
+ append_config("V8_EXTERNAL");
+#endif
#ifdef PDF_ENABLE_XFA
- config.append(maybe_comma);
- config.append("XFA");
- maybe_comma = ",";
-#endif // PDF_ENABLE_XFA
+ append_config("XFA");
+#endif
#ifdef PDF_ENABLE_ASAN
- config.append(maybe_comma);
- config.append("ASAN");
- maybe_comma = ",";
-#endif // PDF_ENABLE_ASAN
-#if defined(PDF_ENABLE_SKIA)
- config.append(maybe_comma);
- config.append("SKIA");
- maybe_comma = ",";
-#elif defined(PDF_ENABLE_SKIA_PATHS)
- config.append(maybe_comma);
- config.append("SKIAPATHS");
- maybe_comma = ",";
+ append_config("ASAN");
+#endif
+#ifdef PDF_ENABLE_SKIA
+ append_config("SKIA");
#endif
printf("%s\n", config.c_str());
}
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 19bca35..1f8226e 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -26,7 +26,7 @@
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/layout/cfgas_txtbreak.h"
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
#include "core/fxge/cfx_defaultrenderdevice.h"
#endif
@@ -122,7 +122,7 @@
bRet = device->DrawNormalText(pdfium::make_span(pCurCP, iCurCount), font,
-fFontSize, matrix, color, kOptions);
}
-#if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_)
+#ifdef _SKIA_SUPPORT_
if (CFX_DefaultRenderDevice::SkiaIsDefaultRenderer())
device->Flush(false);
#endif