xref: /aosp_15_r20/external/pdfium/core/fxge/win32/cgdi_display_driver.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
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_DISPLAY_DRIVER_H_
8 #define CORE_FXGE_WIN32_CGDI_DISPLAY_DRIVER_H_
9 
10 #include <stdint.h>
11 #include <windows.h>
12 
13 #include <memory>
14 
15 #include "core/fxcrt/retain_ptr.h"
16 #include "core/fxge/win32/cgdi_device_driver.h"
17 
18 class CFX_DIBBase;
19 struct FXDIB_ResampleOptions;
20 struct FX_RECT;
21 
22 class CGdiDisplayDriver final : public CGdiDeviceDriver {
23  public:
24   explicit CGdiDisplayDriver(HDC hDC);
25   ~CGdiDisplayDriver() override;
26 
27  private:
28   // CGdiDisplayDriver:
29   int GetDeviceCaps(int caps_id) const override;
30   bool GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap,
31                  int left,
32                  int top) override;
33   bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
34                  uint32_t color,
35                  const FX_RECT& src_rect,
36                  int left,
37                  int top,
38                  BlendMode blend_type) override;
39   bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
40                      uint32_t color,
41                      int dest_left,
42                      int dest_top,
43                      int dest_width,
44                      int dest_height,
45                      const FX_RECT* pClipRect,
46                      const FXDIB_ResampleOptions& options,
47                      BlendMode blend_type) override;
48   bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
49                    int bitmap_alpha,
50                    uint32_t color,
51                    const CFX_Matrix& matrix,
52                    const FXDIB_ResampleOptions& options,
53                    std::unique_ptr<CFX_ImageRenderer>* handle,
54                    BlendMode blend_type) override;
55 
56   bool UseFoxitStretchEngine(const RetainPtr<CFX_DIBBase>& pSource,
57                              uint32_t color,
58                              int dest_left,
59                              int dest_top,
60                              int dest_width,
61                              int dest_height,
62                              const FX_RECT* pClipRect,
63                              const FXDIB_ResampleOptions& options);
64 };
65 
66 #endif  // CORE_FXGE_WIN32_CGDI_DISPLAY_DRIVER_H_
67