Lines Matching full:buffersize
51 static void test_incremental_buffering(skiatest::Reporter* reporter, size_t bufferSize) {
54 SkAutoTUnref<SkStream> bufferedStream(SkFrontBufferedStream::Create(&memStream, bufferSize));
58 test_read(reporter, bufferedStream, gAbcs, bufferSize / 2);
63 test_read(reporter, bufferedStream, gAbcs, bufferSize / 4);
66 test_read(reporter, bufferedStream, gAbcs + bufferedStream->getPosition(), bufferSize / 2);
71 test_read(reporter, bufferedStream, gAbcs, bufferSize << 1);
79 static void test_perfectly_sized_buffer(skiatest::Reporter* reporter, size_t bufferSize) {
81 SkAutoTUnref<SkStream> bufferedStream(SkFrontBufferedStream::Create(&memStream, bufferSize));
85 test_read(reporter, bufferedStream, gAbcs, bufferSize);
91 test_read(reporter, bufferedStream, gAbcs, bufferSize);
98 static void test_skipping(skiatest::Reporter* reporter, size_t bufferSize) {
100 SkAutoTUnref<SkStream> bufferedStream(SkFrontBufferedStream::Create(&memStream, bufferSize));
104 bufferedStream->skip(bufferSize / 2);
108 test_read(reporter, bufferedStream, gAbcs, bufferSize / 4);
111 bufferedStream->skip(bufferSize / 2);
114 test_read(reporter, bufferedStream, gAbcs + bufferedStream->getPosition(), bufferSize / 4);
117 test_read(reporter, bufferedStream, gAbcs, bufferSize);
148 static void test_read_beyond_buffer(skiatest::Reporter* reporter, size_t bufferSize) {
150 AndroidLikeMemoryStream memStream((void*)gAbcs, bufferSize, false);
153 SkAutoTUnref<SkStream> bufferedStream(SkFrontBufferedStream::Create(&memStream, bufferSize));
156 // Attempt to read one more than the bufferSize
157 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize + 1);
161 test_read(reporter, bufferedStream, gAbcs, bufferSize);
195 static void test_length_combos(skiatest::Reporter* reporter, size_t bufferSize) {
199 SkAutoTUnref<SkStream> buffered(SkFrontBufferedStream::Create(&stream, bufferSize));
206 static void test_initial_offset(skiatest::Reporter* reporter, size_t bufferSize) {
213 SkAutoTUnref<SkStream> bufferedStream(SkFrontBufferedStream::Create(&memStream, bufferSize));
237 static void test_buffers(skiatest::Reporter* reporter, size_t bufferSize) {
238 test_incremental_buffering(reporter, bufferSize);
239 test_perfectly_sized_buffer(reporter, bufferSize);
240 test_skipping(reporter, bufferSize);
241 test_read_beyond_buffer(reporter, bufferSize);
242 test_length_combos(reporter, bufferSize);
243 test_initial_offset(reporter, bufferSize);