summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_imagerenderer.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-16 21:25:27 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-16 21:25:27 +0000
commit027190ec8148a2f1edc18c37eae26e896f3a309a (patch)
tree6f65b1bb530309b8d6656e92e66dad1fcd1e1e44 /xfa/fxfa/cxfa_imagerenderer.h
parent454ab87a354099fb96eee4721328d59f42ca0557 (diff)
downloadpdfium-027190ec8148a2f1edc18c37eae26e896f3a309a.tar.xz
Move CXFA_ImageRenderer to own file
This CL Splits CL_ImageRenderer out of CXFA_FFWidget and moves to a separate file. Methods in CXFA_FFWidget are shuffled around to put the global methods at the top of the file and static methods in the anonymous namespace. Change-Id: I9887a5c9bf9fda63deead7ff785dc4ef3d7e15c8 Reviewed-on: https://pdfium-review.googlesource.com/23031 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_imagerenderer.h')
-rw-r--r--xfa/fxfa/cxfa_imagerenderer.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/xfa/fxfa/cxfa_imagerenderer.h b/xfa/fxfa/cxfa_imagerenderer.h
new file mode 100644
index 0000000000..ca53bf639e
--- /dev/null
+++ b/xfa/fxfa/cxfa_imagerenderer.h
@@ -0,0 +1,61 @@
+// Copyright 2018 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 XFA_FXFA_CXFA_IMAGERENDERER_H_
+#define XFA_FXFA_CXFA_IMAGERENDERER_H_
+
+#include <memory>
+
+#include "core/fxcrt/fx_coordinates.h"
+#include "core/fxcrt/retain_ptr.h"
+#include "core/fxge/fx_dib.h"
+
+class CFX_RenderDevice;
+class CFX_DIBSource;
+class CFX_DIBitmap;
+class CFX_ImageTransformer;
+class CFX_ImageRenderer;
+
+class CXFA_ImageRenderer {
+ public:
+ CXFA_ImageRenderer();
+ ~CXFA_ImageRenderer();
+
+ bool Start(CFX_RenderDevice* pDevice,
+ const RetainPtr<CFX_DIBSource>& pDIBSource,
+ FX_ARGB bitmap_argb,
+ int bitmap_alpha,
+ const CFX_Matrix* pImage2Device,
+ uint32_t flags,
+ int blendType = FXDIB_BLEND_NORMAL);
+ bool Continue();
+
+ protected:
+ bool StartDIBSource();
+ void CompositeDIBitmap(const RetainPtr<CFX_DIBitmap>& pDIBitmap,
+ int left,
+ int top,
+ FX_ARGB mask_argb,
+ int bitmap_alpha,
+ int blend_mode,
+ int iTransparency);
+
+ CFX_RenderDevice* m_pDevice;
+ int m_Status = 0;
+ CFX_Matrix m_ImageMatrix;
+ RetainPtr<CFX_DIBSource> m_pDIBSource;
+ RetainPtr<CFX_DIBitmap> m_pCloneConvert;
+ int m_BitmapAlpha = 255;
+ FX_ARGB m_FillArgb = 0;
+ uint32_t m_Flags = 0;
+ std::unique_ptr<CFX_ImageTransformer> m_pTransformer;
+ std::unique_ptr<CFX_ImageRenderer> m_DeviceHandle;
+ int32_t m_BlendType = FXDIB_BLEND_NORMAL;
+ bool m_Result = true;
+ bool m_bPrint = false;
+};
+
+#endif // XFA_FXFA_CXFA_IMAGERENDERER_H_