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

Side by Side Diff: core/fxge/win32/win32_int.h

Issue 2608663003: Pdfium Patch to restore PS Path (Closed)
Patch Set: Created 3 years, 11 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/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/fpdfview.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_FXGE_WIN32_WIN32_INT_H_ 7 #ifndef CORE_FXGE_WIN32_WIN32_INT_H_
8 #define CORE_FXGE_WIN32_WIN32_INT_H_ 8 #define CORE_FXGE_WIN32_WIN32_INT_H_
9 9
10 #include <windows.h> 10 #include <windows.h>
11 11
12 #include <memory>
13
12 #include "core/fxge/cfx_pathdata.h" 14 #include "core/fxge/cfx_pathdata.h"
13 #include "core/fxge/ifx_renderdevicedriver.h" 15 #include "core/fxge/ifx_renderdevicedriver.h"
14 #include "core/fxge/win32/dwrite_int.h" 16 #include "core/fxge/win32/dwrite_int.h"
17 #include "core/fxge/win32/fx_ge_ps.h"
15 18
16 struct FXTEXT_CHARPOS; 19 struct FXTEXT_CHARPOS;
17 struct WINDIB_Open_Args_; 20 struct WINDIB_Open_Args_;
18 21
19 typedef HANDLE(__stdcall* FuncType_GdiAddFontMemResourceEx)(PVOID pbFont, 22 typedef HANDLE(__stdcall* FuncType_GdiAddFontMemResourceEx)(PVOID pbFont,
20 DWORD cbFont, 23 DWORD cbFont,
21 PVOID pdv, 24 PVOID pdv,
22 DWORD* pcFonts); 25 DWORD* pcFonts);
23 typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle); 26 typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle);
24 27
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 const FXTEXT_CHARPOS* pCharPos, 256 const FXTEXT_CHARPOS* pCharPos,
254 CFX_Font* pFont, 257 CFX_Font* pFont,
255 const CFX_Matrix* pObject2Device, 258 const CFX_Matrix* pObject2Device,
256 FX_FLOAT font_size, 259 FX_FLOAT font_size,
257 uint32_t color) override; 260 uint32_t color) override;
258 261
259 const int m_HorzSize; 262 const int m_HorzSize;
260 const int m_VertSize; 263 const int m_VertSize;
261 }; 264 };
262 265
266 class CPSOutput : public IFX_PSOutput {
267 public:
268 explicit CPSOutput(HDC hDC);
269 ~CPSOutput() override;
270
271 // IFX_PSOutput
272 void Release() override { delete this; }
273 void OutputPS(const FX_CHAR* str, int len) override;
274
275 HDC m_hDC;
276 };
277
278 class CPSPrinterDriver : public IFX_RenderDeviceDriver {
279 public:
280 CPSPrinterDriver(HDC hDC, int pslevel, bool bCmykOutput);
281 ~CPSPrinterDriver() override;
282
283 protected:
284 // IFX_RenderDeviceDriver
285 int GetDeviceCaps(int caps_id) const override;
286 bool StartRendering() override;
287 void EndRendering() override;
288 void SaveState() override;
289 void RestoreState(bool bKeepSaved) override;
290 bool SetClip_PathFill(const CFX_PathData* pPathData,
291 const CFX_Matrix* pObject2Device,
292 int fill_mode) override;
293 bool SetClip_PathStroke(const CFX_PathData* pPathData,
294 const CFX_Matrix* pObject2Device,
295 const CFX_GraphStateData* pGraphState) override;
296 bool DrawPath(const CFX_PathData* pPathData,
297 const CFX_Matrix* pObject2Device,
298 const CFX_GraphStateData* pGraphState,
299 uint32_t fill_color,
300 uint32_t stroke_color,
301 int fill_mode,
302 int blend_type) override;
303 bool GetClipBox(FX_RECT* pRect) override;
304 bool SetDIBits(const CFX_DIBSource* pBitmap,
305 uint32_t color,
306 const FX_RECT* pSrcRect,
307 int left,
308 int top,
309 int blend_type) override;
310 bool StretchDIBits(const CFX_DIBSource* pBitmap,
311 uint32_t color,
312 int dest_left,
313 int dest_top,
314 int dest_width,
315 int dest_height,
316 const FX_RECT* pClipRect,
317 uint32_t flags,
318 int blend_type) override;
319 bool StartDIBits(const CFX_DIBSource* pBitmap,
320 int bitmap_alpha,
321 uint32_t color,
322 const CFX_Matrix* pMatrix,
323 uint32_t render_flags,
324 void*& handle,
325 int blend_type) override;
326 bool DrawDeviceText(int nChars,
327 const FXTEXT_CHARPOS* pCharPos,
328 CFX_Font* pFont,
329 const CFX_Matrix* pObject2Device,
330 FX_FLOAT font_size,
331 uint32_t color) override;
332 void* GetPlatformSurface() const override { return (void*)m_hDC; }
333
334 HDC m_hDC;
335 const bool m_bCmykOutput;
336 int m_Width;
337 int m_Height;
338 int m_nBitsPerPixel;
339 int m_HorzSize;
340 int m_VertSize;
341 std::unique_ptr<CPSOutput> m_pPSOutput;
342 CFX_PSRenderer m_PSRenderer;
343 };
344
263 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ 345 #endif // CORE_FXGE_WIN32_WIN32_INT_H_
OLDNEW
« 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