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

Side by Side Diff: tests/PDFDeflateWStreamTest.cpp

Issue 2273343002: SkPDF: Stop `#include PREPROCESSOR_DEFINE` pattern (Closed)
Patch Set: fix gyp/pdf.gyp syntax error Created 4 years, 3 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 | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkDeflate.h" 8 #include "SkDeflate.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "Test.h" 10 #include "Test.h"
11 11
12 namespace { 12 namespace {
13 13
14 #ifdef ZLIB_INCLUDE 14 #include "zlib.h"
15 #include ZLIB_INCLUDE
16 #else
17 #include "zlib.h"
18 #endif
19 15
20 // Different zlib implementations use different T. 16 // Different zlib implementations use different T.
21 // We've seen size_t and unsigned. 17 // We've seen size_t and unsigned.
22 template <typename T> void* skia_alloc_func(void*, T items, T size) { 18 template <typename T> void* skia_alloc_func(void*, T items, T size) {
23 return sk_calloc_throw(SkToSizeT(items) * SkToSizeT(size)); 19 return sk_calloc_throw(SkToSizeT(items) * SkToSizeT(size));
24 } 20 }
25 21
26 void skia_free_func(void*, void* address) { sk_free(address); } 22 void skia_free_func(void*, void* address) { sk_free(address); }
27 23
28 /** 24 /**
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 uint8_t c; 153 uint8_t c;
158 SkDEBUGCODE(size_t rb =)decompressed->read(&c, sizeof(uint8_t)); 154 SkDEBUGCODE(size_t rb =)decompressed->read(&c, sizeof(uint8_t));
159 SkASSERT(sizeof(uint8_t) == rb); 155 SkASSERT(sizeof(uint8_t) == rb);
160 if (buffer[i] != c) { 156 if (buffer[i] != c) {
161 ERRORF(r, "Decompression failed at byte %u.", (unsigned)i); 157 ERRORF(r, "Decompression failed at byte %u.", (unsigned)i);
162 break; 158 break;
163 } 159 }
164 } 160 }
165 } 161 }
166 } 162 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698