1 // Copyright 2020 The PDFium Authors 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_WIN32_CGDI_PLUS_EXT_H_ 8 #define CORE_FXGE_WIN32_CGDI_PLUS_EXT_H_ 9 10 #include <stdint.h> 11 #include <windows.h> 12 13 #include <vector> 14 15 #include "core/fxcrt/retain_ptr.h" 16 17 class CFX_DIBBase; 18 class CFX_GraphStateData; 19 class CFX_Matrix; 20 class CFX_Path; 21 struct CFX_FillRenderOptions; 22 struct FXDIB_ResampleOptions; 23 struct FX_RECT; 24 25 class CGdiplusExt { 26 public: 27 CGdiplusExt(); 28 ~CGdiplusExt(); 29 30 void Load(); IsAvailable()31 bool IsAvailable() { return !!m_hModule; } 32 bool StretchDIBits(HDC hDC, 33 const RetainPtr<CFX_DIBBase>& source, 34 int dest_left, 35 int dest_top, 36 int dest_width, 37 int dest_height, 38 const FX_RECT* pClipRect, 39 const FXDIB_ResampleOptions& options); 40 bool DrawPath(HDC hDC, 41 const CFX_Path& path, 42 const CFX_Matrix* pObject2Device, 43 const CFX_GraphStateData* pGraphState, 44 uint32_t fill_argb, 45 uint32_t stroke_argb, 46 const CFX_FillRenderOptions& fill_options); 47 48 std::vector<FARPROC> m_Functions; 49 50 private: 51 HMODULE m_hModule = nullptr; 52 HMODULE m_GdiModule = nullptr; 53 }; 54 55 #endif // CORE_FXGE_WIN32_CGDI_PLUS_EXT_H_ 56