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

Unified Diff: trunk/src/cbdt.cc

Issue 341983012: OTS: Add DoNotDropColorBitmapTables() API. (Closed) Base URL: http://ots.googlecode.com/svn/
Patch Set: Created 6 years, 6 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 | « trunk/src/cbdt.h ('k') | trunk/src/cblc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cbdt.cc
===================================================================
--- trunk/src/cbdt.cc (revision 0)
+++ trunk/src/cbdt.cc (working copy)
@@ -0,0 +1,41 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cbdt.h"
+
+// CBDT
+// https://color-emoji.googlecode.com/git/specification/v1.html
+// We don't support the table, but provide a way not to drop the table.
+
+namespace ots {
+
+extern bool g_drop_color_bitmap_tables;
+
+bool ots_cbdt_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
+ if (g_drop_color_bitmap_tables) {
+ return OTS_FAILURE();
+ }
+
+ file->cbdt = new OpenTypeCBDT;
+ file->cbdt->data = data;
+ file->cbdt->length = length;
+ return true;
+}
+
+bool ots_cbdt_should_serialise(OpenTypeFile *file) {
+ return file->cbdt != NULL && file->cblc != NULL;
+}
+
+bool ots_cbdt_serialise(OTSStream *out, OpenTypeFile *file) {
+ if (!out->Write(file->cbdt->data, file->cbdt->length)) {
+ return OTS_FAILURE();
+ }
+ return true;
+}
+
+void ots_cbdt_free(OpenTypeFile *file) {
+ delete file->cbdt;
+}
+
+} // namespace ots
« no previous file with comments | « trunk/src/cbdt.h ('k') | trunk/src/cblc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698