OLD | NEW |
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 "SkDeflate.h" |
10 #include "SkStream.h" | 10 #include "SkStream.h" |
11 #include "Test.h" | 11 #include "Test.h" |
12 | 12 |
13 // 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 |
14 // an unseekable file stream would. | 14 // an unseekable file stream would. |
15 class SkZeroSizeMemStream : public SkMemoryStream { | 15 class SkZeroSizeMemStream : public SkMemoryStream { |
16 public: | 16 public: |
17 virtual size_t read(void* buffer, size_t size) { | 17 virtual size_t read(void* buffer, size_t size) { |
18 if (buffer == NULL && size == 0) | 18 if (buffer == NULL && size == 0) |
19 return 0; | 19 return 0; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 DEF_TEST(Flate, reporter) { | 106 DEF_TEST(Flate, reporter) { |
107 SkMemoryStream memStream; | 107 SkMemoryStream memStream; |
108 TestFlate(reporter, &memStream, 512); | 108 TestFlate(reporter, &memStream, 512); |
109 TestFlate(reporter, &memStream, 10240); | 109 TestFlate(reporter, &memStream, 10240); |
110 | 110 |
111 SkZeroSizeMemStream fileStream; | 111 SkZeroSizeMemStream fileStream; |
112 TestFlate(reporter, &fileStream, 512); | 112 TestFlate(reporter, &fileStream, 512); |
113 TestFlate(reporter, &fileStream, 10240); | 113 TestFlate(reporter, &fileStream, 10240); |
114 } | 114 } |
OLD | NEW |