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

Unified Diff: core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h

Issue 1805603002: core/include/fdpfapi cleanup Part I. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h
diff --git a/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h b/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h
new file mode 100644
index 0000000000000000000000000000000000000000..eddd4b0c8363fad43f524d580bffed511ab7768d
--- /dev/null
+++ b/core/fpdfapi/fpdf_render/include/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_INCLUDE_CPDF_PROGRESSIVERENDERER_H_
+#define CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_PROGRESSIVERENDERER_H_
+
+#include <memory>
+
+#include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h"
+#include "core/include/fpdfapi/fpdf_page.h"
+#include "core/include/fxcrt/fx_coordinates.h"
+#include "core/include/fxcrt/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<int>(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<CPDF_RenderStatus> m_pRenderStatus;
+ CFX_FloatRect m_ClipRect;
+ FX_DWORD m_LayerIndex;
+ CPDF_RenderContext::Layer* m_pCurrentLayer;
+ CPDF_PageObjectList::iterator m_LastObjectRendered;
+};
+
+#endif // CORE_FPDFAPI_FPDF_RENDER_INCLUDE_CPDF_PROGRESSIVERENDERER_H_
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698