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

Unified Diff: third_party/ots/src/cvt.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/cmap.cc ('k') | third_party/ots/src/fpgm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/cvt.cc
diff --git a/third_party/ots/src/cvt.cc b/third_party/ots/src/cvt.cc
index f83ad0ee207827ded04818a855af06cb9c4adeb2..1402e7c06a66abfcd7065d5860cb334361ccce18 100644
--- a/third_party/ots/src/cvt.cc
+++ b/third_party/ots/src/cvt.cc
@@ -11,11 +11,11 @@
namespace ots {
-bool ots_cvt_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+bool ots_cvt_parse(Font *font, const uint8_t *data, size_t length) {
Buffer table(data, length);
OpenTypeCVT *cvt = new OpenTypeCVT;
- file->cvt = cvt;
+ font->cvt = cvt;
if (length >= 128 * 1024u) {
return OTS_FAILURE_MSG("Length (%d) > 120K"); // almost all cvt tables are less than 4k bytes.
@@ -34,15 +34,15 @@ bool ots_cvt_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
return true;
}
-bool ots_cvt_should_serialise(OpenTypeFile *file) {
- if (!file->glyf) {
+bool ots_cvt_should_serialise(Font *font) {
+ if (!font->glyf) {
return false; // this table is not for CFF fonts.
}
- return file->cvt != NULL;
+ return font->cvt != NULL;
}
-bool ots_cvt_serialise(OTSStream *out, OpenTypeFile *file) {
- const OpenTypeCVT *cvt = file->cvt;
+bool ots_cvt_serialise(OTSStream *out, Font *font) {
+ const OpenTypeCVT *cvt = font->cvt;
if (!out->Write(cvt->data, cvt->length)) {
return OTS_FAILURE_MSG("Failed to write CVT table");
@@ -51,8 +51,13 @@ bool ots_cvt_serialise(OTSStream *out, OpenTypeFile *file) {
return true;
}
-void ots_cvt_free(OpenTypeFile *file) {
- delete file->cvt;
+void ots_cvt_reuse(Font *font, Font *other) {
+ font->cvt = other->cvt;
+ font->cvt_reused = true;
+}
+
+void ots_cvt_free(Font *font) {
+ delete font->cvt;
}
} // namespace ots
« no previous file with comments | « third_party/ots/src/cmap.cc ('k') | third_party/ots/src/fpgm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698