OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_ |
| 8 #define CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_ |
| 9 |
| 10 #include "core/fxcrt/include/fx_system.h" |
| 11 |
| 12 class CFX_DIBitmap; |
| 13 class CFX_DIBSource; |
| 14 class CFX_Font; |
| 15 class CFX_FontCache; |
| 16 class CFX_GraphStateData; |
| 17 class CFX_Matrix; |
| 18 class CFX_PathData; |
| 19 class CPDF_ShadingPattern; |
| 20 class IFX_Pause; |
| 21 struct FXTEXT_CHARPOS; |
| 22 struct FX_RECT; |
| 23 |
| 24 class IFX_RenderDeviceDriver { |
| 25 public: |
| 26 virtual ~IFX_RenderDeviceDriver(); |
| 27 |
| 28 virtual int GetDeviceCaps(int caps_id) const = 0; |
| 29 virtual CFX_Matrix GetCTM() const; |
| 30 |
| 31 virtual FX_BOOL StartRendering(); |
| 32 virtual void EndRendering(); |
| 33 virtual void SaveState() = 0; |
| 34 virtual void RestoreState(bool bKeepSaved) = 0; |
| 35 |
| 36 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
| 37 const CFX_Matrix* pObject2Device, |
| 38 int fill_mode) = 0; |
| 39 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
| 40 const CFX_Matrix* pObject2Device, |
| 41 const CFX_GraphStateData* pGraphState); |
| 42 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
| 43 const CFX_Matrix* pObject2Device, |
| 44 const CFX_GraphStateData* pGraphState, |
| 45 uint32_t fill_color, |
| 46 uint32_t stroke_color, |
| 47 int fill_mode, |
| 48 int blend_type) = 0; |
| 49 virtual FX_BOOL SetPixel(int x, int y, uint32_t color); |
| 50 virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect, |
| 51 uint32_t fill_color, |
| 52 int blend_type); |
| 53 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
| 54 FX_FLOAT y1, |
| 55 FX_FLOAT x2, |
| 56 FX_FLOAT y2, |
| 57 uint32_t color, |
| 58 int blend_type); |
| 59 |
| 60 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; |
| 61 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); |
| 62 virtual CFX_DIBitmap* GetBackDrop(); |
| 63 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 64 uint32_t color, |
| 65 const FX_RECT* pSrcRect, |
| 66 int dest_left, |
| 67 int dest_top, |
| 68 int blend_type) = 0; |
| 69 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 70 uint32_t color, |
| 71 int dest_left, |
| 72 int dest_top, |
| 73 int dest_width, |
| 74 int dest_height, |
| 75 const FX_RECT* pClipRect, |
| 76 uint32_t flags, |
| 77 int blend_type) = 0; |
| 78 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 79 int bitmap_alpha, |
| 80 uint32_t color, |
| 81 const CFX_Matrix* pMatrix, |
| 82 uint32_t flags, |
| 83 void*& handle, |
| 84 int blend_type) = 0; |
| 85 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); |
| 86 virtual void CancelDIBits(void* handle); |
| 87 virtual FX_BOOL DrawDeviceText(int nChars, |
| 88 const FXTEXT_CHARPOS* pCharPos, |
| 89 CFX_Font* pFont, |
| 90 CFX_FontCache* pCache, |
| 91 const CFX_Matrix* pObject2Device, |
| 92 FX_FLOAT font_size, |
| 93 uint32_t color); |
| 94 virtual void* GetPlatformSurface() const; |
| 95 virtual int GetDriverType() const; |
| 96 virtual void ClearDriver(); |
| 97 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, |
| 98 const CFX_Matrix* pMatrix, |
| 99 const FX_RECT& clip_rect, |
| 100 int alpha, |
| 101 FX_BOOL bAlphaMode); |
| 102 }; |
| 103 |
| 104 #endif // CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_ |
OLD | NEW |