xref: /aosp_15_r20/external/pdfium/core/fxge/apple/fx_quartz_device.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2014 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_APPLE_FX_QUARTZ_DEVICE_H_
8 #define CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
9 
10 #include <CoreGraphics/CoreGraphics.h>
11 #include <stdint.h>
12 
13 #include "core/fxcrt/retain_ptr.h"
14 #include "core/fxge/dib/fx_dib.h"
15 #include "third_party/base/containers/span.h"
16 
17 class CFX_DIBitmap;
18 class CFX_Matrix;
19 
20 class CQuartz2D {
21  public:
22   void* CreateGraphics(const RetainPtr<CFX_DIBitmap>& bitmap);
23   void DestroyGraphics(void* graphics);
24 
25   void* CreateFont(pdfium::span<const uint8_t> pFontData);
26   void DestroyFont(void* pFont);
27   void SetGraphicsTextMatrix(void* graphics, const CFX_Matrix& matrix);
28   bool DrawGraphicsString(void* graphics,
29                           void* font,
30                           float fontSize,
31                           pdfium::span<uint16_t> glyphIndices,
32                           pdfium::span<CGPoint> glyphPositions,
33                           FX_ARGB argb);
34 };
35 
36 #endif  // CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
37