Index: tests/PaintTest.cpp |
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp |
index 253ce86769dad008226c5d2b656c77b94ffbf558..98653449474bd43c2c1c6c1561a31612de3d9f1f 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()); |