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

Side by Side Diff: third_party/woff2/src/variable_length.cc

Issue 2736873002: Update woff2 to cbea7b9 (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/woff2/src/glyph.cc ('k') | third_party/woff2/src/woff2_dec.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 Google Inc. All Rights Reserved. 1 // Copyright 2015 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } else { 42 } else {
43 out->push_back(253); 43 out->push_back(253);
44 out->push_back(value >> 8); 44 out->push_back(value >> 8);
45 out->push_back(value & 0xff); 45 out->push_back(value & 0xff);
46 } 46 }
47 } 47 }
48 48
49 void Store255UShort(int val, size_t* offset, uint8_t* dst) { 49 void Store255UShort(int val, size_t* offset, uint8_t* dst) {
50 std::vector<uint8_t> packed; 50 std::vector<uint8_t> packed;
51 Write255UShort(&packed, val); 51 Write255UShort(&packed, val);
52 for (uint8_t val : packed) { 52 for (uint8_t packed_byte : packed) {
53 dst[(*offset)++] = val; 53 dst[(*offset)++] = packed_byte;
54 } 54 }
55 } 55 }
56 56
57 // Based on section 6.1.1 of MicroType Express draft spec 57 // Based on section 6.1.1 of MicroType Express draft spec
58 bool Read255UShort(Buffer* buf, unsigned int* value) { 58 bool Read255UShort(Buffer* buf, unsigned int* value) {
59 static const int kWordCode = 253; 59 static const int kWordCode = 253;
60 static const int kOneMoreByteCode2 = 254; 60 static const int kOneMoreByteCode2 = 254;
61 static const int kOneMoreByteCode1 = 255; 61 static const int kOneMoreByteCode1 = 255;
62 static const int kLowestUCode = 253; 62 static const int kLowestUCode = 253;
63 uint8_t code = 0; 63 uint8_t code = 0;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 int b = static_cast<int>((len >> (7 * (size - i - 1))) & 0x7f); 128 int b = static_cast<int>((len >> (7 * (size - i - 1))) & 0x7f);
129 if (i < size - 1) { 129 if (i < size - 1) {
130 b |= 0x80; 130 b |= 0x80;
131 } 131 }
132 dst[(*offset)++] = b; 132 dst[(*offset)++] = b;
133 } 133 }
134 } 134 }
135 135
136 } // namespace woff2 136 } // namespace woff2
137 137
OLDNEW
« no previous file with comments | « third_party/woff2/src/glyph.cc ('k') | third_party/woff2/src/woff2_dec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698