Lines Matching refs:rfd
143 void ReadFontDataWithSingleByte(ReadableFontData* rfd, ByteVector* buffer) { in ReadFontDataWithSingleByte() argument
144 buffer->resize(rfd->Length()); in ReadFontDataWithSingleByte()
145 for (int32_t index = 0; index < rfd->Length(); ++index) { in ReadFontDataWithSingleByte()
146 (*buffer)[index] = (byte_t)(rfd->ReadByte(index)); in ReadFontDataWithSingleByte()
150 void ReadFontDataWithBuffer(ReadableFontData* rfd, in ReadFontDataWithBuffer() argument
154 b->resize(rfd->Length()); in ReadFontDataWithBuffer()
157 while (index < rfd->Length()) { in ReadFontDataWithBuffer()
158 int32_t bytes_read = rfd->ReadBytes(index, &(buffer[0]), 0, buffer.size()); in ReadFontDataWithBuffer()
165 void ReadFontDataWithSlidingWindow(ReadableFontData* rfd, int32_t window_size, in ReadFontDataWithSlidingWindow() argument
167 b->resize(rfd->Length()); in ReadFontDataWithSlidingWindow()
169 while (index < rfd->Length()) { in ReadFontDataWithSlidingWindow()
173 rfd->ReadBytes(index, &((*b)[0]), index, actual_window_size); in ReadFontDataWithSlidingWindow()
179 void WriteFontDataWithSingleByte(ReadableFontData* rfd, WritableFontData* wfd) { in WriteFontDataWithSingleByte() argument
180 for (int32_t index = 0; index < rfd->Length(); ++index) { in WriteFontDataWithSingleByte()
181 byte_t b = (byte_t)(rfd->ReadByte(index)); in WriteFontDataWithSingleByte()
186 void WriteFontDataWithBuffer(ReadableFontData* rfd, in WriteFontDataWithBuffer() argument
191 while (index < rfd->Length()) { in WriteFontDataWithBuffer()
192 int32_t bytesRead = rfd->ReadBytes(index, &(buffer[0]), 0, buffer.size()); in WriteFontDataWithBuffer()
198 void WriteFontDataWithSlidingWindow(ReadableFontData* rfd, in WriteFontDataWithSlidingWindow() argument
201 ByteVector b(rfd->Length()); in WriteFontDataWithSlidingWindow()
203 while (index < rfd->Length()) { in WriteFontDataWithSlidingWindow()
205 int32_t bytes_read = rfd->ReadBytes(index, &(b[0]), index, sliding_size); in WriteFontDataWithSlidingWindow()
254 void SlicingReadTest(ReadableFontData* rfd) { in SlicingReadTest() argument
256 for (int32_t trim = 0; trim < (rfd->Length() / 2) + 1; in SlicingReadTest()
257 trim += (rfd->Length() / 21) + 1) { in SlicingReadTest()
259 int32_t length = rfd->Length() - 2 * trim; in SlicingReadTest()
261 slice.Attach(down_cast<ReadableFontData*>(rfd->Slice(trim, length))); in SlicingReadTest()
262 EXPECT_TRUE(ReadComparison(trim, length, rfd, slice)); in SlicingReadTest()
267 void SlicingWriteTest(ReadableFontData* rfd, WritableFontData* wfd) { in SlicingWriteTest() argument
269 for (int32_t trim = 0; trim < (rfd->Length() / 2) + 1; in SlicingWriteTest()
270 trim += (rfd->Length() / 21) + 1) { in SlicingWriteTest()
272 int32_t length = rfd->Length() - 2 * trim; in SlicingWriteTest()
278 r_slice.Attach(down_cast<ReadableFontData*>(rfd->Slice(trim, length))); in SlicingWriteTest()
280 EXPECT_TRUE(ReadComparison(trim, length, rfd, w_slice)); in SlicingWriteTest()
287 r_slice.Attach(down_cast<ReadableFontData*>(rfd->Slice(trim, length))); in SlicingWriteTest()
289 EXPECT_TRUE(ReadComparison(trim, length, rfd, w_slice)); in SlicingWriteTest()
295 r_slice.Attach(down_cast<ReadableFontData*>(rfd->Slice(trim, length))); in SlicingWriteTest()
297 EXPECT_TRUE(ReadComparison(trim, length, rfd, w_slice)); in SlicingWriteTest()
308 ReadableFontDataPtr rfd = new ReadableFontData(ba); in TestReadableFontData() local
309 SlicingReadTest(rfd); in TestReadableFontData()