From 61df2c78c3fb28bb3c3bd9be90e4c0aa03cd55a6 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 12:31:44 -0700 Subject: Move core/fpdfapi/fpdf_render/include to core/fpdfapi/fpdf_render BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382763002 --- .../fpdfapi/fpdf_render/cpdf_progressiverenderer.h | 62 ++++++++++++++++++++ core/fpdfapi/fpdf_render/cpdf_rendercontext.h | 67 ++++++++++++++++++++++ core/fpdfapi/fpdf_render/cpdf_renderoptions.h | 54 +++++++++++++++++ core/fpdfapi/fpdf_render/cpdf_textrenderer.h | 60 +++++++++++++++++++ core/fpdfapi/fpdf_render/fpdf_render.cpp | 6 +- core/fpdfapi/fpdf_render/fpdf_render_cache.cpp | 2 +- core/fpdfapi/fpdf_render/fpdf_render_image.cpp | 4 +- core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 4 +- core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 4 +- .../fpdf_render/include/cpdf_progressiverenderer.h | 62 -------------------- .../fpdf_render/include/cpdf_rendercontext.h | 67 ---------------------- .../fpdf_render/include/cpdf_renderoptions.h | 54 ----------------- .../fpdf_render/include/cpdf_textrenderer.h | 60 ------------------- core/fpdfapi/fpdf_render/render_int.h | 2 +- 14 files changed, 254 insertions(+), 254 deletions(-) create mode 100644 core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h create mode 100644 core/fpdfapi/fpdf_render/cpdf_rendercontext.h create mode 100644 core/fpdfapi/fpdf_render/cpdf_renderoptions.h create mode 100644 core/fpdfapi/fpdf_render/cpdf_textrenderer.h delete mode 100644 core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h delete mode 100644 core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h delete mode 100644 core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h delete mode 100644 core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h (limited to 'core/fpdfapi/fpdf_render') diff --git a/core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h b/core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h new file mode 100644 index 0000000000..cbc98a1bfb --- /dev/null +++ b/core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h @@ -0,0 +1,62 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_PROGRESSIVERENDERER_H_ +#define CORE_FPDFAPI_FPDF_RENDER_CPDF_PROGRESSIVERENDERER_H_ + +#include + +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" +#include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_RenderOptions; +class CPDF_RenderStatus; +class CFX_RenderDevice; +class IFX_Pause; + +class CPDF_ProgressiveRenderer { + public: + // Must match FDF_RENDER_* definitions in public/fpdf_progressive.h, but + // cannot #include that header. fpdfsdk/fpdf_progressive.cpp has + // static_asserts to make sure the two sets of values match. + enum Status { + Ready, // FPDF_RENDER_READER + ToBeContinued, // FPDF_RENDER_TOBECOUNTINUED + Done, // FPDF_RENDER_DONE + Failed // FPDF_RENDER_FAILED + }; + + static int ToFPDFStatus(Status status) { return static_cast(status); } + + CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext, + CFX_RenderDevice* pDevice, + const CPDF_RenderOptions* pOptions); + ~CPDF_ProgressiveRenderer(); + + Status GetStatus() const { return m_Status; } + void Start(IFX_Pause* pPause); + void Continue(IFX_Pause* pPause); + + private: + void RenderStep(); + + // Maximum page objects to render before checking for pause. + static const int kStepLimit = 100; + + Status m_Status; + CPDF_RenderContext* const m_pContext; + CFX_RenderDevice* const m_pDevice; + const CPDF_RenderOptions* const m_pOptions; + std::unique_ptr m_pRenderStatus; + CFX_FloatRect m_ClipRect; + uint32_t m_LayerIndex; + CPDF_RenderContext::Layer* m_pCurrentLayer; + CPDF_PageObjectList::iterator m_LastObjectRendered; +}; + +#endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_PROGRESSIVERENDERER_H_ diff --git a/core/fpdfapi/fpdf_render/cpdf_rendercontext.h b/core/fpdfapi/fpdf_render/cpdf_rendercontext.h new file mode 100644 index 0000000000..900e3a3d89 --- /dev/null +++ b/core/fpdfapi/fpdf_render/cpdf_rendercontext.h @@ -0,0 +1,67 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDERCONTEXT_H_ +#define CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDERCONTEXT_H_ + +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CPDF_Dictionary; +class CPDF_Document; +class CPDF_Page; +class CPDF_PageObject; +class CPDF_PageObjectHolder; +class CPDF_PageRenderCache; +class CPDF_RenderOptions; +class CFX_DIBitmap; +class CFX_Matrix; +class CFX_RenderDevice; + +class CPDF_RenderContext { + public: + class Layer { + public: + CPDF_PageObjectHolder* m_pObjectHolder; + CFX_Matrix m_Matrix; + }; + + explicit CPDF_RenderContext(CPDF_Page* pPage); + CPDF_RenderContext(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache); + ~CPDF_RenderContext(); + + void AppendLayer(CPDF_PageObjectHolder* pObjectHolder, + const CFX_Matrix* pObject2Device); + + void Render(CFX_RenderDevice* pDevice, + const CPDF_RenderOptions* pOptions, + const CFX_Matrix* pFinalMatrix); + + void Render(CFX_RenderDevice* pDevice, + const CPDF_PageObject* pStopObj, + const CPDF_RenderOptions* pOptions, + const CFX_Matrix* pFinalMatrix); + + void GetBackground(CFX_DIBitmap* pBuffer, + const CPDF_PageObject* pObj, + const CPDF_RenderOptions* pOptions, + CFX_Matrix* pFinalMatrix); + + uint32_t CountLayers() const { return m_Layers.GetSize(); } + Layer* GetLayer(uint32_t index) { return m_Layers.GetDataPtr(index); } + + CPDF_Document* GetDocument() const { return m_pDocument; } + CPDF_Dictionary* GetPageResources() const { return m_pPageResources; } + CPDF_PageRenderCache* GetPageCache() const { return m_pPageCache; } + + protected: + CPDF_Document* const m_pDocument; + CPDF_Dictionary* m_pPageResources; + CPDF_PageRenderCache* m_pPageCache; + CFX_ArrayTemplate m_Layers; +}; + +#endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDERCONTEXT_H_ diff --git a/core/fpdfapi/fpdf_render/cpdf_renderoptions.h b/core/fpdfapi/fpdf_render/cpdf_renderoptions.h new file mode 100644 index 0000000000..dc45423ce2 --- /dev/null +++ b/core/fpdfapi/fpdf_render/cpdf_renderoptions.h @@ -0,0 +1,54 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDEROPTIONS_H_ +#define CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDEROPTIONS_H_ + +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/fx_dib.h" + +class CPDF_OCContext; + +#define RENDER_COLOR_NORMAL 0 +#define RENDER_COLOR_GRAY 1 +#define RENDER_COLOR_TWOCOLOR 2 +#define RENDER_COLOR_ALPHA 3 +#define RENDER_CLEARTYPE 0x00000001 +#define RENDER_PRINTGRAPHICTEXT 0x00000002 +#define RENDER_FORCE_DOWNSAMPLE 0x00000004 +#define RENDER_PRINTPREVIEW 0x00000008 +#define RENDER_BGR_STRIPE 0x00000010 +#define RENDER_NO_NATIVETEXT 0x00000020 +#define RENDER_FORCE_HALFTONE 0x00000040 +#define RENDER_RECT_AA 0x00000080 +#define RENDER_FILL_FULLCOVER 0x00000100 +#define RENDER_PRINTIMAGETEXT 0x00000200 +#define RENDER_OVERPRINT 0x00000400 +#define RENDER_THINLINE 0x00000800 +#define RENDER_NOTEXTSMOOTH 0x10000000 +#define RENDER_NOPATHSMOOTH 0x20000000 +#define RENDER_NOIMAGESMOOTH 0x40000000 +#define RENDER_LIMITEDIMAGECACHE 0x80000000 + +class CPDF_RenderOptions { + public: + CPDF_RenderOptions(); + CPDF_RenderOptions(const CPDF_RenderOptions& rhs); + FX_ARGB TranslateColor(FX_ARGB argb) const; + + int m_ColorMode; + FX_COLORREF m_BackColor; + FX_COLORREF m_ForeColor; + uint32_t m_Flags; + int m_Interpolation; + uint32_t m_AddFlags; + CPDF_OCContext* m_pOCContext; + uint32_t m_dwLimitCacheSize; + int m_HalftoneLimit; + bool m_bDrawAnnots; +}; + +#endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_RENDEROPTIONS_H_ diff --git a/core/fpdfapi/fpdf_render/cpdf_textrenderer.h b/core/fpdfapi/fpdf_render/cpdf_textrenderer.h new file mode 100644 index 0000000000..ddc9edc7fc --- /dev/null +++ b/core/fpdfapi/fpdf_render/cpdf_textrenderer.h @@ -0,0 +1,60 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_TEXTRENDERER_H_ +#define CORE_FPDFAPI_FPDF_RENDER_CPDF_TEXTRENDERER_H_ + +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/fx_dib.h" + +class CFX_RenderDevice; +class CFX_GraphStateData; +class CFX_PathData; +class CPDF_RenderOptions; +class CPDF_Font; + +class CPDF_TextRenderer { + public: + static void DrawTextString(CFX_RenderDevice* pDevice, + FX_FLOAT origin_x, + FX_FLOAT origin_y, + CPDF_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* matrix, + const CFX_ByteString& str, + FX_ARGB fill_argb, + FX_ARGB stroke_argb, + const CFX_GraphStateData* pGraphState, + const CPDF_RenderOptions* pOptions); + + static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, + int nChars, + uint32_t* pCharCodes, + FX_FLOAT* pCharPos, + CPDF_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* pText2User, + const CFX_Matrix* pUser2Device, + const CFX_GraphStateData* pGraphState, + FX_ARGB fill_argb, + FX_ARGB stroke_argb, + CFX_PathData* pClippingPath, + int nFlag); + + static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, + int nChars, + uint32_t* pCharCodes, + FX_FLOAT* pCharPos, + CPDF_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* pText2Device, + FX_ARGB fill_argb, + const CPDF_RenderOptions* pOptions); +}; + +#endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_TEXTRENDERER_H_ diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp index 1c21d04be7..5bd2df8cc3 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp @@ -24,10 +24,10 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" +#include "core/fpdfapi/fpdf_render/cpdf_progressiverenderer.h" +#include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" +#include "core/fpdfapi/fpdf_render/cpdf_textrenderer.h" #include "core/fpdfapi/fpdf_render/cpdf_type3cache.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" #include "core/fpdfapi/include/cpdf_modulemgr.h" #include "core/fpdfdoc/include/cpdf_occontext.h" #include "core/fxge/include/cfx_fxgedevice.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp index c78bde0472..33b0f3bca5 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -9,7 +9,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_page.h" #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" +#include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" #include "core/fpdfapi/fpdf_render/render_int.h" struct CACHEINFO { diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp index 5b852d172d..cfb392d649 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -21,8 +21,8 @@ #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" +#include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" +#include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fpdfdoc/include/cpdf_occontext.h" #include "core/fxcodec/include/fx_codec.h" #include "core/fxcrt/include/fx_safe_types.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 67b35509a0..b31ae211ab 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -19,8 +19,8 @@ #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" +#include "core/fpdfapi/fpdf_render/cpdf_rendercontext.h" +#include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fxge/include/cfx_fxgedevice.h" #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp index 27bafd1c04..0f4becf240 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -20,9 +20,9 @@ #include "core/fpdfapi/fpdf_page/pageint.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_document.h" +#include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" +#include "core/fpdfapi/fpdf_render/cpdf_textrenderer.h" #include "core/fpdfapi/fpdf_render/cpdf_type3cache.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" #include "core/fxge/include/cfx_facecache.h" #include "core/fxge/include/cfx_fxgedevice.h" #include "core/fxge/include/cfx_gemodule.h" diff --git a/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h b/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h deleted file mode 100644 index 96e30412d5..0000000000 --- a/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_PROGRESSIVERENDERER_H_ -#define CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_PROGRESSIVERENDERER_H_ - -#include - -#include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_RenderOptions; -class CPDF_RenderStatus; -class CFX_RenderDevice; -class IFX_Pause; - -class CPDF_ProgressiveRenderer { - public: - // Must match FDF_RENDER_* definitions in public/fpdf_progressive.h, but - // cannot #include that header. fpdfsdk/fpdf_progressive.cpp has - // static_asserts to make sure the two sets of values match. - enum Status { - Ready, // FPDF_RENDER_READER - ToBeContinued, // FPDF_RENDER_TOBECOUNTINUED - Done, // FPDF_RENDER_DONE - Failed // FPDF_RENDER_FAILED - }; - - static int ToFPDFStatus(Status status) { return static_cast(status); } - - CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext, - CFX_RenderDevice* pDevice, - const CPDF_RenderOptions* pOptions); - ~CPDF_ProgressiveRenderer(); - - Status GetStatus() const { return m_Status; } - void Start(IFX_Pause* pPause); - void Continue(IFX_Pause* pPause); - - private: - void RenderStep(); - - // Maximum page objects to render before checking for pause. - static const int kStepLimit = 100; - - Status m_Status; - CPDF_RenderContext* const m_pContext; - CFX_RenderDevice* const m_pDevice; - const CPDF_RenderOptions* const m_pOptions; - std::unique_ptr m_pRenderStatus; - CFX_FloatRect m_ClipRect; - uint32_t m_LayerIndex; - CPDF_RenderContext::Layer* m_pCurrentLayer; - CPDF_PageObjectList::iterator m_LastObjectRendered; -}; - -#endif // CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_PROGRESSIVERENDERER_H_ diff --git a/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h b/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h deleted file mode 100644 index 9d67db1558..0000000000 --- a/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_RENDERCONTEXT_H_ -#define CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_RENDERCONTEXT_H_ - -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CPDF_Dictionary; -class CPDF_Document; -class CPDF_Page; -class CPDF_PageObject; -class CPDF_PageObjectHolder; -class CPDF_PageRenderCache; -class CPDF_RenderOptions; -class CFX_DIBitmap; -class CFX_Matrix; -class CFX_RenderDevice; - -class CPDF_RenderContext { - public: - class Layer { - public: - CPDF_PageObjectHolder* m_pObjectHolder; - CFX_Matrix m_Matrix; - }; - - explicit CPDF_RenderContext(CPDF_Page* pPage); - CPDF_RenderContext(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache); - ~CPDF_RenderContext(); - - void AppendLayer(CPDF_PageObjectHolder* pObjectHolder, - const CFX_Matrix* pObject2Device); - - void Render(CFX_RenderDevice* pDevice, - const CPDF_RenderOptions* pOptions, - const CFX_Matrix* pFinalMatrix); - - void Render(CFX_RenderDevice* pDevice, - const CPDF_PageObject* pStopObj, - const CPDF_RenderOptions* pOptions, - const CFX_Matrix* pFinalMatrix); - - void GetBackground(CFX_DIBitmap* pBuffer, - const CPDF_PageObject* pObj, - const CPDF_RenderOptions* pOptions, - CFX_Matrix* pFinalMatrix); - - uint32_t CountLayers() const { return m_Layers.GetSize(); } - Layer* GetLayer(uint32_t index) { return m_Layers.GetDataPtr(index); } - - CPDF_Document* GetDocument() const { return m_pDocument; } - CPDF_Dictionary* GetPageResources() const { return m_pPageResources; } - CPDF_PageRenderCache* GetPageCache() const { return m_pPageCache; } - - protected: - CPDF_Document* const m_pDocument; - CPDF_Dictionary* m_pPageResources; - CPDF_PageRenderCache* m_pPageCache; - CFX_ArrayTemplate m_Layers; -}; - -#endif // CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_RENDERCONTEXT_H_ diff --git a/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h b/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h deleted file mode 100644 index 7c513aea9e..0000000000 --- a/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_RENDEROPTIONS_H_ -#define CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_RENDEROPTIONS_H_ - -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/fx_dib.h" - -class CPDF_OCContext; - -#define RENDER_COLOR_NORMAL 0 -#define RENDER_COLOR_GRAY 1 -#define RENDER_COLOR_TWOCOLOR 2 -#define RENDER_COLOR_ALPHA 3 -#define RENDER_CLEARTYPE 0x00000001 -#define RENDER_PRINTGRAPHICTEXT 0x00000002 -#define RENDER_FORCE_DOWNSAMPLE 0x00000004 -#define RENDER_PRINTPREVIEW 0x00000008 -#define RENDER_BGR_STRIPE 0x00000010 -#define RENDER_NO_NATIVETEXT 0x00000020 -#define RENDER_FORCE_HALFTONE 0x00000040 -#define RENDER_RECT_AA 0x00000080 -#define RENDER_FILL_FULLCOVER 0x00000100 -#define RENDER_PRINTIMAGETEXT 0x00000200 -#define RENDER_OVERPRINT 0x00000400 -#define RENDER_THINLINE 0x00000800 -#define RENDER_NOTEXTSMOOTH 0x10000000 -#define RENDER_NOPATHSMOOTH 0x20000000 -#define RENDER_NOIMAGESMOOTH 0x40000000 -#define RENDER_LIMITEDIMAGECACHE 0x80000000 - -class CPDF_RenderOptions { - public: - CPDF_RenderOptions(); - CPDF_RenderOptions(const CPDF_RenderOptions& rhs); - FX_ARGB TranslateColor(FX_ARGB argb) const; - - int m_ColorMode; - FX_COLORREF m_BackColor; - FX_COLORREF m_ForeColor; - uint32_t m_Flags; - int m_Interpolation; - uint32_t m_AddFlags; - CPDF_OCContext* m_pOCContext; - uint32_t m_dwLimitCacheSize; - int m_HalftoneLimit; - bool m_bDrawAnnots; -}; - -#endif // CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_RENDEROPTIONS_H_ diff --git a/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h b/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h deleted file mode 100644 index c4031bbbff..0000000000 --- a/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_TEXTRENDERER_H_ -#define CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_TEXTRENDERER_H_ - -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/fx_dib.h" - -class CFX_RenderDevice; -class CFX_GraphStateData; -class CFX_PathData; -class CPDF_RenderOptions; -class CPDF_Font; - -class CPDF_TextRenderer { - public: - static void DrawTextString(CFX_RenderDevice* pDevice, - FX_FLOAT origin_x, - FX_FLOAT origin_y, - CPDF_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* matrix, - const CFX_ByteString& str, - FX_ARGB fill_argb, - FX_ARGB stroke_argb, - const CFX_GraphStateData* pGraphState, - const CPDF_RenderOptions* pOptions); - - static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, - int nChars, - uint32_t* pCharCodes, - FX_FLOAT* pCharPos, - CPDF_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* pText2User, - const CFX_Matrix* pUser2Device, - const CFX_GraphStateData* pGraphState, - FX_ARGB fill_argb, - FX_ARGB stroke_argb, - CFX_PathData* pClippingPath, - int nFlag); - - static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, - int nChars, - uint32_t* pCharCodes, - FX_FLOAT* pCharPos, - CPDF_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* pText2Device, - FX_ARGB fill_argb, - const CPDF_RenderOptions* pOptions); -}; - -#endif // CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_TEXTRENDERER_H_ diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h index 4eaaf264e3..b193344ca5 100644 --- a/core/fpdfapi/fpdf_render/render_int.h +++ b/core/fpdfapi/fpdf_render/render_int.h @@ -15,7 +15,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_countedobject.h" #include "core/fpdfapi/fpdf_page/cpdf_graphicstates.h" #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" -#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" +#include "core/fpdfapi/fpdf_render/cpdf_renderoptions.h" #include "core/fxge/include/cfx_fxgedevice.h" #include "core/fxge/include/cfx_renderdevice.h" -- cgit v1.2.3