Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: core/include/fpdfapi/fpdf_render.h

Issue 1699443002: Rework progressive render loop. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove CPDF_RenderConfig. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/include/fpdfapi/fpdf_module.h ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 static int ToFPDFStatus(Status status) { return static_cast<int>(status); } 129 static int ToFPDFStatus(Status status) { return static_cast<int>(status); }
130 130
131 CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext, 131 CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext,
132 CFX_RenderDevice* pDevice, 132 CFX_RenderDevice* pDevice,
133 const CPDF_RenderOptions* pOptions); 133 const CPDF_RenderOptions* pOptions);
134 ~CPDF_ProgressiveRenderer(); 134 ~CPDF_ProgressiveRenderer();
135 135
136 Status GetStatus() const { return m_Status; } 136 Status GetStatus() const { return m_Status; }
137 void Start(IFX_Pause* pPause); 137 void Start(IFX_Pause* pPause);
138 void Continue(IFX_Pause* pPause); 138 void Continue(IFX_Pause* pPause);
139 int EstimateProgress();
140 139
141 private: 140 private:
142 void RenderStep(); 141 void RenderStep();
143 142
143 // Maximum page objects to render before checking for pause.
144 static const int kStepLimit = 100;
145
144 Status m_Status; 146 Status m_Status;
145 CPDF_RenderContext* const m_pContext; 147 CPDF_RenderContext* const m_pContext;
146 CFX_RenderDevice* const m_pDevice; 148 CFX_RenderDevice* const m_pDevice;
147 const CPDF_RenderOptions* const m_pOptions; 149 const CPDF_RenderOptions* const m_pOptions;
148 std::unique_ptr<CPDF_RenderStatus> m_pRenderStatus; 150 std::unique_ptr<CPDF_RenderStatus> m_pRenderStatus;
149 CFX_FloatRect m_ClipRect; 151 CFX_FloatRect m_ClipRect;
150 FX_DWORD m_LayerIndex; 152 FX_DWORD m_LayerIndex;
151 FX_DWORD m_ObjectIndex; 153 CPDF_RenderContext::Layer* m_pCurrentLayer;
152 FX_POSITION m_ObjectPos; 154 FX_POSITION m_LastObjectRendered;
153 FX_POSITION m_PrevLastPos;
154 }; 155 };
155 156
156 class CPDF_TextRenderer { 157 class CPDF_TextRenderer {
157 public: 158 public:
158 static void DrawTextString(CFX_RenderDevice* pDevice, 159 static void DrawTextString(CFX_RenderDevice* pDevice,
159 int left, 160 int left,
160 int top, 161 int top,
161 CPDF_Font* pFont, 162 CPDF_Font* pFont,
162 int height, 163 int height,
163 const CFX_ByteString& str, 164 const CFX_ByteString& str,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 255
255 protected: 256 protected:
256 friend class CPDF_Page; 257 friend class CPDF_Page;
257 CPDF_Page* const m_pPage; 258 CPDF_Page* const m_pPage;
258 CPDF_ImageCacheEntry* m_pCurImageCacheEntry; 259 CPDF_ImageCacheEntry* m_pCurImageCacheEntry;
259 std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache; 260 std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache;
260 FX_DWORD m_nTimeCount; 261 FX_DWORD m_nTimeCount;
261 FX_DWORD m_nCacheSize; 262 FX_DWORD m_nCacheSize;
262 FX_BOOL m_bCurFindCache; 263 FX_BOOL m_bCurFindCache;
263 }; 264 };
264 class CPDF_RenderConfig {
265 public:
266 CPDF_RenderConfig();
267 ~CPDF_RenderConfig();
268 int m_HalftoneLimit;
269 int m_RenderStepLimit;
270 };
271 265
272 FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix); 266 FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix);
273 267
274 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ 268 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_module.h ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698