aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PaintTest.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-04-29 13:58:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 13:58:09 -0700
commitb4c899d48d4c5d8e867beb611551f7b55ec60abb (patch)
treec22a1203e79d6d1eef676c1980636fa52f187eca /tests/PaintTest.cpp
parent900bd4a0463bc6471ef07a77120b413bd8f472b2 (diff)
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
Diffstat (limited to 'tests/PaintTest.cpp')
-rw-r--r--tests/PaintTest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index 253ce86769..9865344947 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -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());