• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(RetainPtr<CFX_DIBitmap> bitmap,
31                  int left,
32                  int top) const override;
33   bool SetDIBits(RetainPtr<const CFX_DIBBase> bitmap,
34                  uint32_t color,
35                  const FX_RECT& src_rect,
36                  int left,
37                  int top,
38                  BlendMode blend_type) override;
39   bool StretchDIBits(RetainPtr<const CFX_DIBBase> bitmap,
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   StartResult StartDIBits(RetainPtr<const CFX_DIBBase> bitmap,
49                           float alpha,
50                           uint32_t color,
51                           const CFX_Matrix& matrix,
52                           const FXDIB_ResampleOptions& options,
53                           BlendMode blend_type) override;
54 
55   bool UseFoxitStretchEngine(RetainPtr<const CFX_DIBBase> bitmap,
56                              uint32_t color,
57                              int dest_left,
58                              int dest_top,
59                              int dest_width,
60                              int dest_height,
61                              const FX_RECT* pClipRect,
62                              const FXDIB_ResampleOptions& options);
63 };
64 
65 #endif  // CORE_FXGE_WIN32_CGDI_DISPLAY_DRIVER_H_
66