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

Unified Diff: third_party/ots/src/vmtx.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/vhea.cc ('k') | third_party/ots/src/vorg.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/vmtx.cc
diff --git a/third_party/ots/src/vmtx.cc b/third_party/ots/src/vmtx.cc
index e29d32b29f9b55de3a76727a2d0af75f656b860d..0944e598baca6811d118d2c307a4f00b630767d8 100644
--- a/third_party/ots/src/vmtx.cc
+++ b/third_party/ots/src/vmtx.cc
@@ -15,39 +15,44 @@
namespace ots {
-bool ots_vmtx_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_vmtx_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
OpenTypeVMTX *vmtx = new OpenTypeVMTX;
- file->vmtx = vmtx;
+ font->vmtx = vmtx;
- if (!file->vhea || !file->maxp) {
+ if (!font->vhea || !font->maxp) {
return OTS_FAILURE_MSG("vhea or maxp table missing as needed by vmtx");
}
- if (!ParseMetricsTable(file, &table, file->maxp->num_glyphs,
- &file->vhea->header, &vmtx->metrics)) {
+ if (!ParseMetricsTable(font, &table, font->maxp->num_glyphs,
+ &font->vhea->header, &vmtx->metrics)) {
return OTS_FAILURE_MSG("Failed to parse vmtx metrics");
}
return true;
}
-bool ots_vmtx_should_serialise(OpenTypeFile *file) {
+bool ots_vmtx_should_serialise(Font *font) {
// vmtx should serialise when vhea and GSUB are preserved.
// See the comment in ots_vhea_should_serialise().
- return file->vmtx != NULL && file->vhea != NULL &&
- ots_gsub_should_serialise(file);
+ return font->vmtx != NULL && font->vhea != NULL &&
+ ots_gsub_should_serialise(font);
}
-bool ots_vmtx_serialise(OTSStream *out, OpenTypeFile *file) {
- if (!SerialiseMetricsTable(file, out, &file->vmtx->metrics)) {
+bool ots_vmtx_serialise(OTSStream *out, Font *font) {
+ if (!SerialiseMetricsTable(font, out, &font->vmtx->metrics)) {
return OTS_FAILURE_MSG("Failed to write vmtx metrics");
}
return true;
}
-void ots_vmtx_free(OpenTypeFile *file) {
- delete file->vmtx;
+void ots_vmtx_reuse(Font *font, Font *other) {
+ font->vmtx = other->vmtx;
+ font->vmtx_reused = true;
+}
+
+void ots_vmtx_free(Font *font) {
+ delete font->vmtx;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/vhea.cc ('k') | third_party/ots/src/vorg.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698