summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2016-03-23 19:21:44 -0400
committerdan sinclair <dsinclair@chromium.org>2016-03-23 19:21:44 -0400
commit61b2fc718910a5ab2a75ec5026b239ff33bccfdc (patch)
tree4031f4cea10dac3d77969035e66fc17235cb1d3d /core/fpdfapi/fpdf_render
parent46a8a2041868c5df6883647226dab1482e2bf4c2 (diff)
downloadpdfium-61b2fc718910a5ab2a75ec5026b239ff33bccfdc.tar.xz
Split core/include/fpdfapi/fpdf_resource.h
This CL splits apart the core/include/fpdfapi/fpdf_resource.h file and places the classes into individual files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1824033002 .
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render.cpp3
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_image.cpp3
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp66
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp3
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp26
-rw-r--r--core/fpdfapi/fpdf_render/render_int.h4
6 files changed, 18 insertions, 87 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp
index 3f79abe1b8..24ca282322 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -6,10 +6,13 @@
#include "core/fpdfapi/fpdf_render/render_int.h"
+#include "core/fpdfapi/fpdf_font/cpdf_type3char.h"
+#include "core/fpdfapi/fpdf_font/cpdf_type3font.h"
#include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h"
#include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_formobject.h"
+#include "core/fpdfapi/fpdf_page/include/cpdf_image.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h"
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index bda2a4469f..b28aee6980 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -10,7 +10,10 @@
#include <vector>
#include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h"
+#include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h"
+#include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
+#include "core/fpdfapi/fpdf_page/include/cpdf_image.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_page/pageint.h"
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 5c4f7f593c..1ad091e7af 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -11,6 +11,7 @@
#include <vector>
#include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h"
+#include "core/fpdfapi/fpdf_page/include/cpdf_image.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h"
#include "core/fpdfapi/fpdf_page/pageint.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
@@ -92,71 +93,6 @@ const int kMaxImageDimension = 0x01FFFF;
} // namespace
-CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask,
- FX_DWORD* pMatteColor,
- FX_BOOL bStdCS,
- FX_DWORD GroupFamily,
- FX_BOOL bLoadMask) const {
- std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
- if (source->Load(m_pDocument, m_pStream,
- reinterpret_cast<CPDF_DIBSource**>(ppMask), pMatteColor,
- nullptr, nullptr, bStdCS, GroupFamily, bLoadMask)) {
- return source.release();
- }
- return nullptr;
-}
-
-CFX_DIBSource* CPDF_Image::DetachBitmap() {
- CFX_DIBSource* pBitmap = m_pDIBSource;
- m_pDIBSource = nullptr;
- return pBitmap;
-}
-
-CFX_DIBSource* CPDF_Image::DetachMask() {
- CFX_DIBSource* pBitmap = m_pMask;
- m_pMask = nullptr;
- return pBitmap;
-}
-
-FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource,
- CPDF_Dictionary* pPageResource,
- FX_BOOL bStdCS,
- FX_DWORD GroupFamily,
- FX_BOOL bLoadMask) {
- std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
- int ret =
- source->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResource,
- pPageResource, bStdCS, GroupFamily, bLoadMask);
- if (ret == 2) {
- m_pDIBSource = source.release();
- return TRUE;
- }
- if (!ret) {
- m_pDIBSource = nullptr;
- return FALSE;
- }
- m_pMask = source->DetachMask();
- m_MatteColor = source->GetMatteColor();
- m_pDIBSource = source.release();
- return FALSE;
-}
-
-FX_BOOL CPDF_Image::Continue(IFX_Pause* pPause) {
- CPDF_DIBSource* pSource = static_cast<CPDF_DIBSource*>(m_pDIBSource);
- int ret = pSource->ContinueLoadDIBSource(pPause);
- if (ret == 2) {
- return TRUE;
- }
- if (!ret) {
- delete m_pDIBSource;
- m_pDIBSource = nullptr;
- return FALSE;
- }
- m_pMask = pSource->DetachMask();
- m_MatteColor = pSource->GetMatteColor();
- return FALSE;
-}
-
CPDF_DIBSource::CPDF_DIBSource()
: m_pDocument(nullptr),
m_pStream(nullptr),
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 9006f2011f..d4dd8ec211 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -7,7 +7,10 @@
#include "core/fpdfapi/fpdf_render/render_int.h"
#include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h"
+#include "core/fpdfapi/fpdf_page/cpdf_meshstream.h"
#include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h"
+#include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h"
+#include "core/fpdfapi/fpdf_page/cpdf_tilingpattern.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h"
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 44e57e49ea..04b0c93507 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -6,6 +6,10 @@
#include "core/fpdfapi/fpdf_render/render_int.h"
+#include "core/fpdfapi/fpdf_font/cpdf_cidfont.h"
+#include "core/fpdfapi/fpdf_font/cpdf_type3char.h"
+#include "core/fpdfapi/fpdf_font/cpdf_type3font.h"
+#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
#include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_imageobject.h"
@@ -318,27 +322,7 @@ static void ReleaseCachedType3(CPDF_Type3Font* pFont) {
pFont->m_pDocument->GetRenderData()->ReleaseCachedType3(pFont);
pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict());
}
-FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) {
- if (m_pBitmap || !m_pForm) {
- return TRUE;
- }
- if (m_pForm->GetPageObjectList()->size() == 1 && !m_bColored) {
- auto& pPageObj = m_pForm->GetPageObjectList()->front();
- if (pPageObj->IsImage()) {
- m_ImageMatrix = pPageObj->AsImage()->m_Matrix;
- const CFX_DIBSource* pSource =
- pPageObj->AsImage()->m_pImage->LoadDIBSource();
- if (pSource) {
- m_pBitmap = pSource->Clone();
- delete pSource;
- }
- delete m_pForm;
- m_pForm = NULL;
- return TRUE;
- }
- }
- return FALSE;
-}
+
class CPDF_RefType3Cache {
public:
CPDF_RefType3Cache(CPDF_Type3Font* pType3Font) {
diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h
index b171b60fbe..ea1b1d8f6b 100644
--- a/core/fpdfapi/fpdf_render/render_int.h
+++ b/core/fpdfapi/fpdf_render/render_int.h
@@ -10,10 +10,11 @@
#include <map>
#include <memory>
+#include "core/fpdfapi/fpdf_page/cpdf_countedobject.h"
#include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h"
#include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h"
+#include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
-#include "core/include/fpdfapi/fpdf_resource.h"
class CPDF_PageObjectHolder;
class CPDF_PageRenderCache;
@@ -40,6 +41,7 @@ class CPDF_TilingPattern;
class CPDF_Color;
class CPDF_Dictionary;
class CPDF_ImageObject;
+class CPDF_Stream;
#define TYPE3_MAX_BLUES 16