forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhb_wrappers.h
37 lines (27 loc) · 1000 Bytes
/
hb_wrappers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef HB_WRAPPERS_H_
#define HB_WRAPPERS_H_
#include <hb-subset.h>
#include <memory>
namespace HarfbuzzWrappers {
struct hb_blob_deleter {
void operator()(hb_blob_t* ptr) { hb_blob_destroy(ptr); }
};
struct hb_face_deleter {
void operator()(hb_face_t* ptr) { hb_face_destroy(ptr); }
};
struct hb_subset_input_deleter {
void operator()(hb_subset_input_t* ptr) { hb_subset_input_destroy(ptr); }
};
struct hb_set_deleter {
void operator()(hb_set_t* ptr) { hb_set_destroy(ptr); }
};
using HbBlobPtr = std::unique_ptr<hb_blob_t, hb_blob_deleter>;
using HbFacePtr = std::unique_ptr<hb_face_t, hb_face_deleter>;
using HbSubsetInputPtr =
std::unique_ptr<hb_subset_input_t, hb_subset_input_deleter>;
using HbSetPtr = std::unique_ptr<hb_set_t, hb_set_deleter>;
}; // namespace HarfbuzzWrappers
#endif // HB_WRAPPERS_H_s