Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1084)

Unified Diff: third_party/ots/src/maxp.cc

Issue 1252363005: Update OTS to revision a7a3b94 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ots/src/math.cc ('k') | third_party/ots/src/metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/maxp.cc
diff --git a/third_party/ots/src/maxp.cc b/third_party/ots/src/maxp.cc
index aaf00760a90c0c01214b1f6cdd917255ab69c8e7..41e29a7452f7fddf26fc97b75530a47524207f10 100644
--- a/third_party/ots/src/maxp.cc
+++ b/third_party/ots/src/maxp.cc
@@ -11,11 +11,11 @@
namespace ots {
-bool ots_maxp_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_maxp_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
OpenTypeMAXP *maxp = new OpenTypeMAXP;
- file->maxp = maxp;
+ font->maxp = maxp;
uint32_t version = 0;
if (!table.ReadU32(&version)) {
@@ -72,12 +72,12 @@ bool ots_maxp_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return true;
}
-bool ots_maxp_should_serialise(OpenTypeFile *file) {
- return file->maxp != NULL;
+bool ots_maxp_should_serialise(Font *font) {
+ return font->maxp != NULL;
}
-bool ots_maxp_serialise(OTSStream *out, OpenTypeFile *file) {
- const OpenTypeMAXP *maxp = file->maxp;
+bool ots_maxp_serialise(OTSStream *out, Font *font) {
+ const OpenTypeMAXP *maxp = font->maxp;
if (!out->WriteU32(maxp->version_1 ? 0x00010000 : 0x00005000) ||
!out->WriteU16(maxp->num_glyphs)) {
@@ -111,8 +111,13 @@ bool ots_maxp_serialise(OTSStream *out, OpenTypeFile *file) {
return true;
}
-void ots_maxp_free(OpenTypeFile *file) {
- delete file->maxp;
+void ots_maxp_reuse(Font *font, Font *other) {
+ font->maxp = other->maxp;
+ font->maxp_reused = true;
+}
+
+void ots_maxp_free(Font *font) {
+ delete font->maxp;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/math.cc ('k') | third_party/ots/src/metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698