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

Unified Diff: core/fxge/win32/win32_int.h

Issue 2608663003: Pdfium Patch to restore PS Path (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « core/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/win32/win32_int.h
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h
index ae090b72d3e63cbfd9e2c9dbe81382e287221eba..f26cf3ed894d2c2d75509b580394dd34380f95e0 100644
--- a/core/fxge/win32/win32_int.h
+++ b/core/fxge/win32/win32_int.h
@@ -9,9 +9,12 @@
#include <windows.h>
+#include <memory>
+
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/ifx_renderdevicedriver.h"
#include "core/fxge/win32/dwrite_int.h"
+#include "core/fxge/win32/fx_ge_ps.h"
struct FXTEXT_CHARPOS;
struct WINDIB_Open_Args_;
@@ -260,4 +263,83 @@ class CGdiPrinterDriver : public CGdiDeviceDriver {
const int m_VertSize;
};
+class CPSOutput : public IFX_PSOutput {
+ public:
+ explicit CPSOutput(HDC hDC);
+ ~CPSOutput() override;
+
+ // IFX_PSOutput
+ void Release() override { delete this; }
+ void OutputPS(const FX_CHAR* str, int len) override;
+
+ HDC m_hDC;
+};
+
+class CPSPrinterDriver : public IFX_RenderDeviceDriver {
+ public:
+ CPSPrinterDriver(HDC hDC, int pslevel, bool bCmykOutput);
+ ~CPSPrinterDriver() override;
+
+ protected:
+ // IFX_RenderDeviceDriver
+ int GetDeviceCaps(int caps_id) const override;
+ bool StartRendering() override;
+ void EndRendering() override;
+ void SaveState() override;
+ void RestoreState(bool bKeepSaved) override;
+ bool SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ int fill_mode) override;
+ bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState) override;
+ bool DrawPath(const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ uint32_t fill_color,
+ uint32_t stroke_color,
+ int fill_mode,
+ int blend_type) override;
+ bool GetClipBox(FX_RECT* pRect) override;
+ bool SetDIBits(const CFX_DIBSource* pBitmap,
+ uint32_t color,
+ const FX_RECT* pSrcRect,
+ int left,
+ int top,
+ int blend_type) override;
+ bool StretchDIBits(const CFX_DIBSource* pBitmap,
+ uint32_t color,
+ int dest_left,
+ int dest_top,
+ int dest_width,
+ int dest_height,
+ const FX_RECT* pClipRect,
+ uint32_t flags,
+ int blend_type) override;
+ bool StartDIBits(const CFX_DIBSource* pBitmap,
+ int bitmap_alpha,
+ uint32_t color,
+ const CFX_Matrix* pMatrix,
+ uint32_t render_flags,
+ void*& handle,
+ int blend_type) override;
+ bool DrawDeviceText(int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ const CFX_Matrix* pObject2Device,
+ FX_FLOAT font_size,
+ uint32_t color) override;
+ void* GetPlatformSurface() const override { return (void*)m_hDC; }
+
+ HDC m_hDC;
+ const bool m_bCmykOutput;
+ int m_Width;
+ int m_Height;
+ int m_nBitsPerPixel;
+ int m_HorzSize;
+ int m_VertSize;
+ std::unique_ptr<CPSOutput> m_pPSOutput;
+ CFX_PSRenderer m_PSRenderer;
+};
+
#endif // CORE_FXGE_WIN32_WIN32_INT_H_
« no previous file with comments | « core/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698