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

Unified Diff: third_party/ots/src/vdmx.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/prep.cc ('k') | third_party/ots/src/vhea.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/vdmx.cc
diff --git a/third_party/ots/src/vdmx.cc b/third_party/ots/src/vdmx.cc
index 4853d631a439c454af9133e72ff4a0dd11d7ed6f..cd80946aee50b1965a4d9e1882a23a9159383712 100644
--- a/third_party/ots/src/vdmx.cc
+++ b/third_party/ots/src/vdmx.cc
@@ -11,18 +11,18 @@
#define DROP_THIS_TABLE(...) \
do { \
- OTS_FAILURE_MSG_(file, TABLE_NAME ": " __VA_ARGS__); \
+ OTS_FAILURE_MSG_(font->file, TABLE_NAME ": " __VA_ARGS__); \
OTS_FAILURE_MSG("Table discarded"); \
- delete file->vdmx; \
- file->vdmx = 0; \
+ delete font->vdmx; \
+ font->vdmx = 0; \
} while (0)
namespace ots {
-bool ots_vdmx_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_vdmx_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
- file->vdmx = new OpenTypeVDMX;
- OpenTypeVDMX * const vdmx = file->vdmx;
+ font->vdmx = new OpenTypeVDMX;
+ OpenTypeVDMX * const vdmx = font->vdmx;
if (!table.ReadU16(&vdmx->version) ||
!table.ReadU16(&vdmx->num_recs) ||
@@ -121,13 +121,13 @@ bool ots_vdmx_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return true;
}
-bool ots_vdmx_should_serialise(OpenTypeFile *file) {
- if (!file->glyf) return false; // this table is not for CFF fonts.
- return file->vdmx != NULL;
+bool ots_vdmx_should_serialise(Font *font) {
+ if (!font->glyf) return false; // this table is not for CFF fonts.
+ return font->vdmx != NULL;
}
-bool ots_vdmx_serialise(OTSStream *out, OpenTypeFile *file) {
- OpenTypeVDMX * const vdmx = file->vdmx;
+bool ots_vdmx_serialise(OTSStream *out, Font *font) {
+ OpenTypeVDMX * const vdmx = font->vdmx;
if (!out->WriteU16(vdmx->version) ||
!out->WriteU16(vdmx->num_recs) ||
@@ -171,8 +171,13 @@ bool ots_vdmx_serialise(OTSStream *out, OpenTypeFile *file) {
return true;
}
-void ots_vdmx_free(OpenTypeFile *file) {
- delete file->vdmx;
+void ots_vdmx_reuse(Font *font, Font *other) {
+ font->vdmx = other->vdmx;
+ font->vdmx_reused = true;
+}
+
+void ots_vdmx_free(Font *font) {
+ delete font->vdmx;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/prep.cc ('k') | third_party/ots/src/vhea.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698