Bug 1758688 [wpt PR 33067] - [FedCM] Make revoke a non-static method, a=testonly
[gecko.git] / gfx / 2d / NativeFontResourceMac.h
blob97683a8a4f3a1685ccecdf972b2fed8e3efae610
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_gfx_NativeFontResourceMac_h
8 #define mozilla_gfx_NativeFontResourceMac_h
10 #include "2D.h"
11 #include "mozilla/AlreadyAddRefed.h"
12 #include "ScaledFontMac.h"
14 namespace mozilla {
15 namespace gfx {
17 class NativeFontResourceMac final : public NativeFontResource {
18 public:
19 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(NativeFontResourceMac, override)
21 static already_AddRefed<NativeFontResourceMac> Create(uint8_t* aFontData,
22 uint32_t aDataLength);
24 already_AddRefed<UnscaledFont> CreateUnscaledFont(
25 uint32_t aIndex, const uint8_t* aInstanceData,
26 uint32_t aInstanceDataLength) final;
28 ~NativeFontResourceMac() {
29 CFRelease(mFontDescRef);
30 CFRelease(mFontRef);
33 static void RegisterMemoryReporter();
35 private:
36 explicit NativeFontResourceMac(CTFontDescriptorRef aFontDescRef,
37 CGFontRef aFontRef, size_t aDataLength)
38 : NativeFontResource(aDataLength),
39 mFontDescRef(aFontDescRef),
40 mFontRef(aFontRef) {}
42 CTFontDescriptorRef mFontDescRef;
43 CGFontRef mFontRef;
46 } // namespace gfx
47 } // namespace mozilla
49 #endif // mozilla_gfx_NativeFontResourceMac_h