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

Unified Diff: third_party/ots/src/fpgm.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/cvt.cc ('k') | third_party/ots/src/gasp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/fpgm.cc
diff --git a/third_party/ots/src/fpgm.cc b/third_party/ots/src/fpgm.cc
index eba03e73e6f5e1df6f46eaf4f092fb6cae070f44..faa9a2392ad5c3500954102d99c6c0ec355c297c 100644
--- a/third_party/ots/src/fpgm.cc
+++ b/third_party/ots/src/fpgm.cc
@@ -11,11 +11,11 @@
namespace ots {
-bool ots_fpgm_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_fpgm_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
OpenTypeFPGM *fpgm = new OpenTypeFPGM;
- file->fpgm = fpgm;
+ font->fpgm = fpgm;
if (length >= 128 * 1024u) {
return OTS_FAILURE_MSG("length (%ld) > 120", length); // almost all fpgm tables are less than 5k bytes.
@@ -30,13 +30,13 @@ bool ots_fpgm_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return true;
}
-bool ots_fpgm_should_serialise(OpenTypeFile *file) {
- if (!file->glyf) return false; // this table is not for CFF fonts.
- return file->fpgm != NULL;
+bool ots_fpgm_should_serialise(Font *font) {
+ if (!font->glyf) return false; // this table is not for CFF fonts.
+ return font->fpgm != NULL;
}
-bool ots_fpgm_serialise(OTSStream *out, OpenTypeFile *file) {
- const OpenTypeFPGM *fpgm = file->fpgm;
+bool ots_fpgm_serialise(OTSStream *out, Font *font) {
+ const OpenTypeFPGM *fpgm = font->fpgm;
if (!out->Write(fpgm->data, fpgm->length)) {
return OTS_FAILURE_MSG("Failed to write fpgm");
@@ -45,8 +45,13 @@ bool ots_fpgm_serialise(OTSStream *out, OpenTypeFile *file) {
return true;
}
-void ots_fpgm_free(OpenTypeFile *file) {
- delete file->fpgm;
+void ots_fpgm_reuse(Font *font, Font *other) {
+ font->fpgm = other->fpgm;
+ font->fpgm_reused = true;
+}
+
+void ots_fpgm_free(Font *font) {
+ delete font->fpgm;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/cvt.cc ('k') | third_party/ots/src/gasp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698