OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This is the implementation of decompression of the proposed WOFF Ultra | 5 // This is the implementation of decompression of the proposed WOFF Ultra |
6 // Condensed file format. | 6 // Condensed file format. |
7 | 7 |
8 #include <cassert> | 8 #include <cassert> |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 #include <vector> | 10 #include <vector> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 const unsigned int kWoff2FlagsContinueStream = 1 << 4; | 49 const unsigned int kWoff2FlagsContinueStream = 1 << 4; |
50 const unsigned int kWoff2FlagsTransform = 1 << 5; | 50 const unsigned int kWoff2FlagsTransform = 1 << 5; |
51 | 51 |
52 // Compression type values common to both short and long formats | 52 // Compression type values common to both short and long formats |
53 const uint32_t kCompressionTypeMask = 0xf; | 53 const uint32_t kCompressionTypeMask = 0xf; |
54 const uint32_t kCompressionTypeNone = 0; | 54 const uint32_t kCompressionTypeNone = 0; |
55 const uint32_t kCompressionTypeGzip = 1; | 55 const uint32_t kCompressionTypeGzip = 1; |
56 const uint32_t kCompressionTypeBrotli = 2; | 56 const uint32_t kCompressionTypeBrotli = 2; |
57 | 57 |
58 // This is a special value for the short format only, as described in | |
59 // "Design for compressed header format" in draft doc. | |
60 const uint32_t kShortFlagsContinue = 3; | |
61 | |
62 const uint32_t kKnownTags[] = { | 58 const uint32_t kKnownTags[] = { |
63 TAG('c', 'm', 'a', 'p'), // 0 | 59 TAG('c', 'm', 'a', 'p'), // 0 |
64 TAG('h', 'e', 'a', 'd'), // 1 | 60 TAG('h', 'e', 'a', 'd'), // 1 |
65 TAG('h', 'h', 'e', 'a'), // 2 | 61 TAG('h', 'h', 'e', 'a'), // 2 |
66 TAG('h', 'm', 't', 'x'), // 3 | 62 TAG('h', 'm', 't', 'x'), // 3 |
67 TAG('m', 'a', 'x', 'p'), // 4 | 63 TAG('m', 'a', 'x', 'p'), // 4 |
68 TAG('n', 'a', 'm', 'e'), // 5 | 64 TAG('n', 'a', 'm', 'e'), // 5 |
69 TAG('O', 'S', '/', '2'), // 6 | 65 TAG('O', 'S', '/', '2'), // 6 |
70 TAG('p', 'o', 's', 't'), // 7 | 66 TAG('p', 'o', 's', 't'), // 7 |
71 TAG('c', 'v', 't', ' '), // 8 | 67 TAG('c', 'v', 't', ' '), // 8 |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 if (transform_buf > &uncompressed_buf[0] + uncompressed_buf.size()) { | 1000 if (transform_buf > &uncompressed_buf[0] + uncompressed_buf.size()) { |
1005 return OTS_FAILURE(); | 1001 return OTS_FAILURE(); |
1006 } | 1002 } |
1007 } | 1003 } |
1008 } | 1004 } |
1009 | 1005 |
1010 return FixChecksums(tables, result); | 1006 return FixChecksums(tables, result); |
1011 } | 1007 } |
1012 | 1008 |
1013 } // namespace ots | 1009 } // namespace ots |
OLD | NEW |