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

Side by Side Diff: tests/PDFFlateTest.cpp

Issue 1278403006: SkPDF: clean up overuse of SK_SUPPORT_PDF (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-11 (Tuesday) 16:25:36 EDT Created 5 years, 4 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 | « tests/PDFDocumentTest.cpp ('k') | tests/PDFGlyphsToUnicodeTest.cpp » ('j') | 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 2011 Google Inc. 2 * Copyright 2011 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 "SkData.h" 8 #include "SkData.h"
9 #include "SkFlate.h" 9 #include "SkFlate.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
11 #include "Test.h" 11 #include "Test.h"
12 12
13 #if SK_SUPPORT_PDF
14
15 // A memory stream that reports zero size with the standard call, like 13 // A memory stream that reports zero size with the standard call, like
16 // an unseekable file stream would. 14 // an unseekable file stream would.
17 class SkZeroSizeMemStream : public SkMemoryStream { 15 class SkZeroSizeMemStream : public SkMemoryStream {
18 public: 16 public:
19 virtual size_t read(void* buffer, size_t size) { 17 virtual size_t read(void* buffer, size_t size) {
20 if (buffer == NULL && size == 0) 18 if (buffer == NULL && size == 0)
21 return 0; 19 return 0;
22 if (buffer == NULL && size == kGetSizeKey) 20 if (buffer == NULL && size == kGetSizeKey)
23 size = 0; 21 size = 0;
24 return SkMemoryStream::read(buffer, size); 22 return SkMemoryStream::read(buffer, size);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 105
108 DEF_TEST(Flate, reporter) { 106 DEF_TEST(Flate, reporter) {
109 SkMemoryStream memStream; 107 SkMemoryStream memStream;
110 TestFlate(reporter, &memStream, 512); 108 TestFlate(reporter, &memStream, 512);
111 TestFlate(reporter, &memStream, 10240); 109 TestFlate(reporter, &memStream, 10240);
112 110
113 SkZeroSizeMemStream fileStream; 111 SkZeroSizeMemStream fileStream;
114 TestFlate(reporter, &fileStream, 512); 112 TestFlate(reporter, &fileStream, 512);
115 TestFlate(reporter, &fileStream, 10240); 113 TestFlate(reporter, &fileStream, 10240);
116 } 114 }
117 #endif // SK_SUPPORT_PDF
OLDNEW
« no previous file with comments | « tests/PDFDocumentTest.cpp ('k') | tests/PDFGlyphsToUnicodeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698