projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf22338
)
[serializer] Add serialize_copy()
author
Behdad Esfahbod
<behdad@behdad.org>
Thu, 2 May 2019 21:04:51 +0000
(14:04 -0700)
committer
Behdad Esfahbod
<behdad@behdad.org>
Thu, 2 May 2019 21:04:51 +0000
(14:04 -0700)
src/hb-open-type.hh
patch
|
blob
|
history
diff --git
a/src/hb-open-type.hh
b/src/hb-open-type.hh
index
bde0596
..
17e8d2a
100644
(file)
--- a/
src/hb-open-type.hh
+++ b/
src/hb-open-type.hh
@@
-305,6
+305,20
@@
struct OffsetTo : Offset<OffsetType, has_null>
return ret;
}
+ template <typename T>
+ bool serialize_copy (hb_serialize_context_t *c, const T &src, const void *base)
+ {
+ *this = 0;
+ if (has_null && &src == &Null (T))
+ return false;
+
+ c->push ();
+
+ c->copy (src);
+
+ c->add_link (*this, c->pop_pack (), base);
+ }
+
bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);