summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/page/cpdf_devicecs.cpp13
-rw-r--r--core/fpdfapi/parser/cfdf_document.cpp15
-rw-r--r--core/fpdfapi/parser/cfdf_document.h2
-rw-r--r--core/fxcodec/fx_codec.h7
-rw-r--r--core/fxcrt/cfx_binarybuf.cpp20
-rw-r--r--core/fxcrt/cfx_binarybuf.h2
-rw-r--r--core/fxcrt/fx_coordinates.cpp6
-rw-r--r--core/fxcrt/fx_coordinates.h1
8 files changed, 3 insertions, 63 deletions
diff --git a/core/fpdfapi/page/cpdf_devicecs.cpp b/core/fpdfapi/page/cpdf_devicecs.cpp
index 276d19b174..efd0ae4f46 100644
--- a/core/fpdfapi/page/cpdf_devicecs.cpp
+++ b/core/fpdfapi/page/cpdf_devicecs.cpp
@@ -36,19 +36,6 @@ uint32_t ComponentsForFamily(int family) {
return 4;
}
-void sRGB_to_AdobeCMYK(float R,
- float G,
- float B,
- float& c,
- float& m,
- float& y,
- float& k) {
- c = 1.0f - R;
- m = 1.0f - G;
- y = 1.0f - B;
- k = std::min(c, std::min(m, y));
-}
-
void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels) {
if (pDestBuf == pSrcBuf) {
for (int i = 0; i < pixels; i++) {
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index 55493b257d..f6af4546d7 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -29,20 +29,11 @@ std::unique_ptr<CFDF_Document> CFDF_Document::CreateNewDoc() {
return pDoc;
}
-std::unique_ptr<CFDF_Document> CFDF_Document::ParseFile(
- const RetainPtr<IFX_SeekableReadStream>& pFile) {
- if (!pFile)
- return nullptr;
-
- auto pDoc = pdfium::MakeUnique<CFDF_Document>();
- pDoc->ParseStream(pFile);
- return pDoc->m_pRootDict ? std::move(pDoc) : nullptr;
-}
-
std::unique_ptr<CFDF_Document> CFDF_Document::ParseMemory(uint8_t* pData,
uint32_t size) {
- return CFDF_Document::ParseFile(
- pdfium::MakeRetain<CFX_MemoryStream>(pData, size, false));
+ auto pDoc = pdfium::MakeUnique<CFDF_Document>();
+ pDoc->ParseStream(pdfium::MakeRetain<CFX_MemoryStream>(pData, size, false));
+ return pDoc->m_pRootDict ? std::move(pDoc) : nullptr;
}
void CFDF_Document::ParseStream(
diff --git a/core/fpdfapi/parser/cfdf_document.h b/core/fpdfapi/parser/cfdf_document.h
index 743c5c0eaa..b2cbd5bae9 100644
--- a/core/fpdfapi/parser/cfdf_document.h
+++ b/core/fpdfapi/parser/cfdf_document.h
@@ -19,8 +19,6 @@ class IFX_SeekableReadStream;
class CFDF_Document : public CPDF_IndirectObjectHolder {
public:
static std::unique_ptr<CFDF_Document> CreateNewDoc();
- static std::unique_ptr<CFDF_Document> ParseFile(
- const RetainPtr<IFX_SeekableReadStream>& pFile);
static std::unique_ptr<CFDF_Document> ParseMemory(uint8_t* pData,
uint32_t size);
diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h
index 0a6d836ddd..923eb7cb71 100644
--- a/core/fxcodec/fx_codec.h
+++ b/core/fxcodec/fx_codec.h
@@ -100,13 +100,6 @@ class CCodec_ModuleMgr {
void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels);
uint32_t ComponentsForFamily(int family);
-void sRGB_to_AdobeCMYK(float R,
- float G,
- float B,
- float& c,
- float& m,
- float& y,
- float& k);
std::tuple<float, float, float> AdobeCMYK_to_sRGB(float c,
float m,
float y,
diff --git a/core/fxcrt/cfx_binarybuf.cpp b/core/fxcrt/cfx_binarybuf.cpp
index 3673fa58d4..1243593a77 100644
--- a/core/fxcrt/cfx_binarybuf.cpp
+++ b/core/fxcrt/cfx_binarybuf.cpp
@@ -12,11 +12,6 @@
CFX_BinaryBuf::CFX_BinaryBuf()
: m_AllocStep(0), m_AllocSize(0), m_DataSize(0) {}
-CFX_BinaryBuf::CFX_BinaryBuf(size_t size)
- : m_AllocStep(0), m_AllocSize(size), m_DataSize(size) {
- m_pBuffer.reset(FX_Alloc(uint8_t, size));
-}
-
CFX_BinaryBuf::~CFX_BinaryBuf() {}
void CFX_BinaryBuf::Delete(size_t start_index, size_t count) {
@@ -77,18 +72,3 @@ void CFX_BinaryBuf::AppendBlock(const void* pBuf, size_t size) {
}
m_DataSize += size;
}
-
-void CFX_BinaryBuf::InsertBlock(size_t pos, const void* pBuf, size_t size) {
- if (size <= 0)
- return;
-
- ExpandBuf(size);
- memmove(m_pBuffer.get() + pos + size, m_pBuffer.get() + pos,
- m_DataSize - pos);
- if (pBuf) {
- memcpy(m_pBuffer.get() + pos, pBuf, size);
- } else {
- memset(m_pBuffer.get() + pos, 0, size);
- }
- m_DataSize += size;
-}
diff --git a/core/fxcrt/cfx_binarybuf.h b/core/fxcrt/cfx_binarybuf.h
index 1a1c821bb9..2d4f019560 100644
--- a/core/fxcrt/cfx_binarybuf.h
+++ b/core/fxcrt/cfx_binarybuf.h
@@ -16,7 +16,6 @@
class CFX_BinaryBuf {
public:
CFX_BinaryBuf();
- explicit CFX_BinaryBuf(size_t size);
virtual ~CFX_BinaryBuf();
uint8_t* GetBuffer() const { return m_pBuffer.get(); }
@@ -36,7 +35,6 @@ class CFX_BinaryBuf {
m_pBuffer.get()[m_DataSize++] = byte;
}
- void InsertBlock(size_t pos, const void* pBuf, size_t size);
void Delete(size_t start_index, size_t count);
// Releases ownership of |m_pBuffer| and returns it.
diff --git a/core/fxcrt/fx_coordinates.cpp b/core/fxcrt/fx_coordinates.cpp
index 733425ef26..db4bea945f 100644
--- a/core/fxcrt/fx_coordinates.cpp
+++ b/core/fxcrt/fx_coordinates.cpp
@@ -313,12 +313,6 @@ float CFX_Matrix::TransformXDistance(float dx) const {
return sqrt(fx * fx + fy * fy);
}
-float CFX_Matrix::TransformDistance(float dx, float dy) const {
- float fx = a * dx + c * dy;
- float fy = b * dx + d * dy;
- return sqrt(fx * fx + fy * fy);
-}
-
float CFX_Matrix::TransformDistance(float distance) const {
return distance * (GetXUnit() + GetYUnit()) / 2;
}
diff --git a/core/fxcrt/fx_coordinates.h b/core/fxcrt/fx_coordinates.h
index 55d28cd66f..c53d157610 100644
--- a/core/fxcrt/fx_coordinates.h
+++ b/core/fxcrt/fx_coordinates.h
@@ -644,7 +644,6 @@ class CFX_Matrix {
CFX_FloatRect GetUnitRect() const;
float TransformXDistance(float dx) const;
- float TransformDistance(float dx, float dy) const;
float TransformDistance(float distance) const;
CFX_PointF Transform(const CFX_PointF& point) const;