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

Side by Side Diff: skia/ext/skia_utils_base.cc

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « skia/ext/skia_utils_base.h ('k') | skia/ext/skia_utils_ios.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) 2013 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 "skia/ext/skia_utils_base.h"
6
7 namespace skia {
8
9 bool ReadSkString(base::PickleIterator* iter, SkString* str) {
10 int reply_length;
11 const char* reply_text;
12
13 if (!iter->ReadData(&reply_text, &reply_length))
14 return false;
15
16 if (str)
17 str->set(reply_text, reply_length);
18 return true;
19 }
20
21 bool ReadSkFontIdentity(base::PickleIterator* iter,
22 SkFontConfigInterface::FontIdentity* identity) {
23 uint32_t reply_id;
24 uint32_t reply_ttcIndex;
25 int reply_length;
26 const char* reply_text;
27
28 if (!iter->ReadUInt32(&reply_id) ||
29 !iter->ReadUInt32(&reply_ttcIndex) ||
30 !iter->ReadData(&reply_text, &reply_length))
31 return false;
32
33 if (identity) {
34 identity->fID = reply_id;
35 identity->fTTCIndex = reply_ttcIndex;
36 identity->fString.set(reply_text, reply_length);
37 }
38 return true;
39 }
40
41 bool WriteSkString(base::Pickle* pickle, const SkString& str) {
42 return pickle->WriteData(str.c_str(), str.size());
43 }
44
45 bool WriteSkFontIdentity(base::Pickle* pickle,
46 const SkFontConfigInterface::FontIdentity& identity) {
47 return pickle->WriteUInt32(identity.fID) &&
48 pickle->WriteUInt32(identity.fTTCIndex) &&
49 WriteSkString(pickle, identity.fString);
50 }
51
52 } // namespace skia
53
OLDNEW
« no previous file with comments | « skia/ext/skia_utils_base.h ('k') | skia/ext/skia_utils_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698