diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-03-08 13:10:55 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-03-08 13:10:55 -0800 |
commit | 310438fb97a2363bd0901401ad2506febd64361b (patch) | |
tree | 82e5fc7ed110134123aded5884ec4ca917e2b39f /core/src/fpdfapi | |
parent | b70f5a44635d29981abac766d727ff54daea2c37 (diff) | |
download | pdfium-310438fb97a2363bd0901401ad2506febd64361b.tar.xz |
Split off CPDF_Document into its own .cpp/.h files.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1780503002 .
Diffstat (limited to 'core/src/fpdfapi')
20 files changed, 32 insertions, 9 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp index 77c58f0925..ad19b5d685 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp @@ -4,6 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_serial.h" diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 878dc2ab2a..ac01bf901c 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -8,6 +8,7 @@ #include <vector> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_parser.h" #include "core/include/fpdfapi/fpdf_serial.h" #include "core/include/fxcrt/fx_ext.h" diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index bc3de20857..8b1571a496 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -6,6 +6,7 @@ #include <limits.h> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/src/fpdfapi/fpdf_page/pageint.h" diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp index 2b68a0403f..0d2f83682e 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp @@ -4,6 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_render.h" diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp index ecdb2d7deb..d9bc148326 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_font/font_int.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_pageobj.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp index 77707624d2..1868d263d3 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp @@ -8,6 +8,7 @@ #include <algorithm> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "third_party/base/stl_util.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp index 49fb331a94..a43aff18cb 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp @@ -10,6 +10,7 @@ #include <algorithm> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fxcodec/fx_codec.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp index 85b026f8e8..fbf236d472 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -7,6 +7,7 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" #include "core/include/fdrm/fx_crypt.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/src/fpdfapi/fpdf_font/font_int.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index a294d3bce7..eff2ff4009 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -8,6 +8,7 @@ #include <algorithm> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_pageobj.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp index c5e29a4b77..64d3264128 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_pageobj.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 1df4f3db37..7114f764ac 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_serial.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index b49607e743..a808c2948b 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -8,6 +8,7 @@ #include <limits.h> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fxcodec/fx_codec.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp index d56e65c084..0287b4fed3 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_page.h" namespace { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/cpdf_document.cpp index a63b0ed336..f837c00509 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp +++ b/core/src/fpdfapi/fpdf_parser/cpdf_document.cpp @@ -4,11 +4,14 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/include/fpdfapi/fpdf_parser.h" +#include "core/include/fpdfapi/cpdf_document.h" #include <set> #include "core/include/fpdfapi/fpdf_module.h" +#include "core/include/fpdfapi/fpdf_parser.h" +#include "core/include/fxge/fx_font.h" +#include "core/src/fpdfapi/fpdf_render/render_int.h" #include "third_party/base/stl_util.h" namespace { @@ -336,3 +339,12 @@ void CPDF_Document::ClearRenderData() { if (m_pDocRender) CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); } + +void CPDF_Document::ClearRenderFont() { + if (!m_pDocRender) + return; + + CFX_FontCache* pCache = m_pDocRender->GetFontCache(); + if (pCache) + pCache->FreeCache(FALSE); +} diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index a00d1bc98d..2b61cdc2a2 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -12,6 +12,7 @@ #include <utility> #include <vector> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fxcrt/fx_ext.h" diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index 4c7abea30c..c054f95abd 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_render/render_int.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_render.h" #include "core/include/fxge/fx_ge.h" diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp index d95885f434..9636d1b23a 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_render/render_int.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_pageobj.h" #include "core/include/fpdfapi/fpdf_render.h" #include "core/include/fxge/fx_ge.h" @@ -331,11 +332,3 @@ void CPDF_ImageCacheEntry::CalcSize() { m_dwCacheSize = FPDF_ImageCache_EstimateImageSize(m_pCachedBitmap) + FPDF_ImageCache_EstimateImageSize(m_pCachedMask); } -void CPDF_Document::ClearRenderFont() { - if (m_pDocRender) { - CFX_FontCache* pCache = m_pDocRender->GetFontCache(); - if (pCache) { - pCache->FreeCache(FALSE); - } - } -} diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index b91f258371..0f9b88e638 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -9,6 +9,7 @@ #include <utility> #include <vector> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_pageobj.h" #include "core/include/fpdfapi/fpdf_render.h" diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 2aa1b0e6df..709733c56f 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -10,6 +10,7 @@ #include <memory> #include <vector> +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_pageobj.h" #include "core/include/fpdfapi/fpdf_render.h" diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp index aa10809496..7051537ef3 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -6,6 +6,7 @@ #include "core/src/fpdfapi/fpdf_render/render_int.h" +#include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_pageobj.h" #include "core/include/fpdfapi/fpdf_render.h" #include "core/include/fxge/fx_ge.h" |