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
11 #include "mozilla/AlreadyAddRefed.h"
12 #include "ScaledFontMac.h"
17 class NativeFontResourceMac final
: public NativeFontResource
{
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
);
33 static void RegisterMemoryReporter();
36 explicit NativeFontResourceMac(CTFontDescriptorRef aFontDescRef
,
37 CGFontRef aFontRef
, size_t aDataLength
)
38 : NativeFontResource(aDataLength
),
39 mFontDescRef(aFontDescRef
),
42 CTFontDescriptorRef mFontDescRef
;
47 } // namespace mozilla
49 #endif // mozilla_gfx_NativeFontResourceMac_h