Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: tests/PaintTest.cpp

Issue 1936563002: remove SkWriteBuffer::getWriter32(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698