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

Side by Side Diff: trunk/src/cbdt.cc

Issue 341983012: OTS: Add DoNotDropColorBitmapTables() API. (Closed) Base URL: http://ots.googlecode.com/svn/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/cbdt.h ('k') | trunk/src/cblc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cbdt.h"
6
7 // CBDT
8 // https://color-emoji.googlecode.com/git/specification/v1.html
9 // We don't support the table, but provide a way not to drop the table.
10
11 namespace ots {
12
13 extern bool g_drop_color_bitmap_tables;
14
15 bool ots_cbdt_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
16 if (g_drop_color_bitmap_tables) {
17 return OTS_FAILURE();
18 }
19
20 file->cbdt = new OpenTypeCBDT;
21 file->cbdt->data = data;
22 file->cbdt->length = length;
23 return true;
24 }
25
26 bool ots_cbdt_should_serialise(OpenTypeFile *file) {
27 return file->cbdt != NULL && file->cblc != NULL;
28 }
29
30 bool ots_cbdt_serialise(OTSStream *out, OpenTypeFile *file) {
31 if (!out->Write(file->cbdt->data, file->cbdt->length)) {
32 return OTS_FAILURE();
33 }
34 return true;
35 }
36
37 void ots_cbdt_free(OpenTypeFile *file) {
38 delete file->cbdt;
39 }
40
41 } // namespace ots
OLDNEW
« 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