remove SkWriteBuffer::getWriter32().
SkWriteBuffer exposes its lower-level implementation SkWriter32 through this one call. It's not currently used in any interesting way: - write_encoded_bitmap() uses it to manually re-create writeDataAsByteArray(); - unit tests use it incidentally as a quick way to read the serialized bytes. This should be SkWriteBuffer no longer necessarily needs to have an SkWriter32. Landing this will let us then remove SkWriter32::contiguousArray(). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936563002 TBR=reed@google.com Just deleting API Review-Url: https://codereview.chromium.org/1936563002
This commit is contained in:
parent
900bd4a046
commit
b4c899d48d
@ -38,7 +38,6 @@ public:
|
||||
return SkToBool(fFlags & kCrossProcess_Flag);
|
||||
}
|
||||
|
||||
SkWriter32* getWriter32() { return &fWriter; }
|
||||
void reset(void* storage = NULL, size_t storageSize = 0) {
|
||||
fWriter.reset(storage, storageSize);
|
||||
}
|
||||
|
@ -136,8 +136,7 @@ bool SkWriteBuffer::writeToStream(SkWStream* stream) {
|
||||
|
||||
static void write_encoded_bitmap(SkWriteBuffer* buffer, SkData* data,
|
||||
const SkIPoint& origin) {
|
||||
buffer->writeUInt(SkToU32(data->size()));
|
||||
buffer->getWriter32()->writePad(data->data(), data->size());
|
||||
buffer->writeDataAsByteArray(data);
|
||||
buffer->write32(origin.fX);
|
||||
buffer->write32(origin.fY);
|
||||
}
|
||||
|
@ -258,8 +258,9 @@ DEF_TEST(Paint_flattening, reporter) {
|
||||
SkWriteBuffer writer;
|
||||
paint.flatten(writer);
|
||||
|
||||
const uint32_t* written = writer.getWriter32()->contiguousArray();
|
||||
SkReadBuffer reader(written, writer.bytesWritten());
|
||||
SkAutoMalloc buf(writer.bytesWritten());
|
||||
writer.writeToMemory(buf.get());
|
||||
SkReadBuffer reader(buf.get(), writer.bytesWritten());
|
||||
|
||||
SkPaint paint2;
|
||||
paint2.unflatten(reader);
|
||||
@ -297,7 +298,10 @@ DEF_TEST(Paint_MoreFlattening, r) {
|
||||
SkWriteBuffer writer;
|
||||
paint.flatten(writer);
|
||||
|
||||
SkReadBuffer reader(writer.getWriter32()->contiguousArray(), writer.bytesWritten());
|
||||
SkAutoMalloc buf(writer.bytesWritten());
|
||||
writer.writeToMemory(buf.get());
|
||||
SkReadBuffer reader(buf.get(), writer.bytesWritten());
|
||||
|
||||
SkPaint other;
|
||||
other.unflatten(reader);
|
||||
ASSERT(reader.offset() == writer.bytesWritten());
|
||||
|
Loading…
Reference in New Issue
Block a user