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

Unified Diff: third_party/ots/src/loca.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/layout.cc ('k') | third_party/ots/src/ltsh.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/loca.cc
diff --git a/third_party/ots/src/loca.cc b/third_party/ots/src/loca.cc
index 4b291f028c0848dacbaec63c68db5da5d11bcd40..aae04c25ab78db23aa5be4e07b28a451a2149068 100644
--- a/third_party/ots/src/loca.cc
+++ b/third_party/ots/src/loca.cc
@@ -14,25 +14,25 @@
namespace ots {
-bool ots_loca_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_loca_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
// We can't do anything useful in validating this data except to ensure that
// the values are monotonically increasing.
OpenTypeLOCA *loca = new OpenTypeLOCA;
- file->loca = loca;
+ font->loca = loca;
- if (!file->maxp || !file->head) {
+ if (!font->maxp || !font->head) {
return OTS_FAILURE_MSG("maxp or head tables missing from font, needed by loca");
}
- const unsigned num_glyphs = file->maxp->num_glyphs;
+ const unsigned num_glyphs = font->maxp->num_glyphs;
unsigned last_offset = 0;
loca->offsets.resize(num_glyphs + 1);
// maxp->num_glyphs is uint16_t, thus the addition never overflows.
- if (file->head->index_to_loc_format == 0) {
+ if (font->head->index_to_loc_format == 0) {
// Note that the <= here (and below) is correct. There is one more offset
// than the number of glyphs in order to give the length of the final
// glyph.
@@ -64,13 +64,13 @@ bool ots_loca_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return true;
}
-bool ots_loca_should_serialise(OpenTypeFile *file) {
- return file->loca != NULL;
+bool ots_loca_should_serialise(Font *font) {
+ return font->loca != NULL;
}
-bool ots_loca_serialise(OTSStream *out, OpenTypeFile *file) {
- const OpenTypeLOCA *loca = file->loca;
- const OpenTypeHEAD *head = file->head;
+bool ots_loca_serialise(OTSStream *out, Font *font) {
+ const OpenTypeLOCA *loca = font->loca;
+ const OpenTypeHEAD *head = font->head;
if (!head) {
return OTS_FAILURE_MSG("Missing head table in font needed by loca");
@@ -95,8 +95,13 @@ bool ots_loca_serialise(OTSStream *out, OpenTypeFile *file) {
return true;
}
-void ots_loca_free(OpenTypeFile *file) {
- delete file->loca;
+void ots_loca_reuse(Font *font, Font *other) {
+ font->loca = other->loca;
+ font->loca_reused = true;
+}
+
+void ots_loca_free(Font *font) {
+ delete font->loca;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/layout.cc ('k') | third_party/ots/src/ltsh.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698