summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_render
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r--core/fpdfapi/fpdf_render/cpdf_pagerendercache.h7
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_cache.cpp7
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_image.cpp5
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp8
-rw-r--r--core/fpdfapi/fpdf_render/render_int.h10
5 files changed, 27 insertions, 10 deletions
diff --git a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
index df0d73ac64..d68856b12b 100644
--- a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
+++ b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
@@ -21,12 +21,7 @@ class IFX_Pause;
class CPDF_PageRenderCache {
public:
- explicit CPDF_PageRenderCache(CPDF_Page* pPage)
- : m_pPage(pPage),
- m_pCurImageCacheEntry(nullptr),
- m_nTimeCount(0),
- m_nCacheSize(0),
- m_bCurFindCache(FALSE) {}
+ explicit CPDF_PageRenderCache(CPDF_Page* pPage);
~CPDF_PageRenderCache();
uint32_t EstimateSize();
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index 07fa2e7b82..055e2f03cb 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -24,6 +24,13 @@ static int compare(const void* data1, const void* data2) {
}
} // extern "C"
+CPDF_PageRenderCache::CPDF_PageRenderCache(CPDF_Page* pPage)
+ : m_pPage(pPage),
+ m_pCurImageCacheEntry(nullptr),
+ m_nTimeCount(0),
+ m_nCacheSize(0),
+ m_bCurFindCache(FALSE) {}
+
CPDF_PageRenderCache::~CPDF_PageRenderCache() {
for (const auto& it : m_ImageCache)
delete it.second;
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 16a06f8f3b..272c779fe8 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -179,6 +179,11 @@ FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat() {
return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb;
#endif
}
+
+FX_ARGB* CPDF_DIBTransferFunc::GetDestPalette() {
+ return nullptr;
+}
+
CPDF_DIBTransferFunc::CPDF_DIBTransferFunc(
const CPDF_TransferFunc* pTransferFunc) {
m_RampR = pTransferFunc->m_Samples;
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 9e3a6c6587..5b0ad96aee 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -45,12 +45,15 @@ void CPDF_UniqueKeyGen::Generate(int count, ...) {
} // namespace
+CPDF_Type3Cache::CPDF_Type3Cache(CPDF_Type3Font* pFont) : m_pFont(pFont) {}
+
CPDF_Type3Cache::~CPDF_Type3Cache() {
for (const auto& pair : m_SizeMap) {
delete pair.second;
}
m_SizeMap.clear();
}
+
CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(uint32_t charcode,
const CFX_Matrix* pMatrix,
FX_FLOAT retinaScaleX,
@@ -77,10 +80,15 @@ CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(uint32_t charcode,
pSizeCache->m_GlyphMap[charcode] = pGlyphBitmap;
return pGlyphBitmap;
}
+
+CPDF_Type3Glyphs::CPDF_Type3Glyphs()
+ : m_TopBlueCount(0), m_BottomBlueCount(0) {}
+
CPDF_Type3Glyphs::~CPDF_Type3Glyphs() {
for (const auto& pair : m_GlyphMap)
delete pair.second;
}
+
static int _AdjustBlue(FX_FLOAT pos, int& count, int blues[]) {
FX_FLOAT min_distance = 1000000.0f * 1.0f;
int closest_pos = -1;
diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h
index f373b9371a..67eae91f59 100644
--- a/core/fpdfapi/fpdf_render/render_int.h
+++ b/core/fpdfapi/fpdf_render/render_int.h
@@ -50,8 +50,9 @@ FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix);
class CPDF_Type3Glyphs {
public:
- CPDF_Type3Glyphs() : m_TopBlueCount(0), m_BottomBlueCount(0) {}
+ CPDF_Type3Glyphs();
~CPDF_Type3Glyphs();
+
void AdjustBlue(FX_FLOAT top,
FX_FLOAT bottom,
int& top_line,
@@ -63,9 +64,10 @@ class CPDF_Type3Glyphs {
int m_TopBlueCount;
int m_BottomBlueCount;
};
+
class CPDF_Type3Cache {
public:
- explicit CPDF_Type3Cache(CPDF_Type3Font* pFont) : m_pFont(pFont) {}
+ explicit CPDF_Type3Cache(CPDF_Type3Font* pFont);
~CPDF_Type3Cache();
CFX_GlyphBitmap* LoadGlyph(uint32_t charcode,
@@ -605,12 +607,12 @@ class CPDF_DIBSource : public CFX_DIBSource {
#define FPDF_HUGE_IMAGE_SIZE 60000000
class CPDF_DIBTransferFunc : public CFX_FilteredDIB {
public:
- CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc);
+ explicit CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc);
~CPDF_DIBTransferFunc() override;
// CFX_FilteredDIB
FXDIB_Format GetDestFormat() override;
- FX_ARGB* GetDestPalette() override { return nullptr; }
+ FX_ARGB* GetDestPalette() override;
void TranslateScanline(uint8_t* dest_buf,
const uint8_t* src_buf) const override;
void TranslateDownSamples(uint8_t* dest_buf,