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

Unified Diff: tests/PaintTest.cpp

Issue 604813003: Remove SkPaint dirty bits. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/SkPictureFlat.h ('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 57d028336aa3431947f5bdbbdad7e65b30e5e2d9..cbb5dadcc523958efb19d33397cb766a7abdba38 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -315,7 +315,7 @@ DEF_TEST(Paint_regression_measureText, reporter) {
#define ASSERT(expr) REPORTER_ASSERT(r, expr)
-DEF_TEST(Paint_FlatteningTraits, r) {
+DEF_TEST(Paint_MoreFlattening, r) {
SkPaint paint;
paint.setColor(0x00AABBCC);
paint.setTextScaleX(1.0f); // Default value, ignored.
@@ -324,20 +324,11 @@ DEF_TEST(Paint_FlatteningTraits, r) {
paint.setLooper(NULL); // Default value, ignored.
SkWriteBuffer writer;
- SkPaint::FlatteningTraits::Flatten(writer, paint);
-
- // BEGIN white box asserts: if the impl changes, these asserts may change
- const size_t expectedBytesWritten = sizeof(void*) == 8 ? 32 : 28;
- ASSERT(expectedBytesWritten == writer.bytesWritten());
-
- const uint32_t* written = writer.getWriter32()->contiguousArray();
- SkASSERT(written != NULL);
- ASSERT(*written == ((1<<0) | (1<<1) | (1<<8))); // Dirty bits for our 3.
- // END white box asserts
+ paint.flatten(writer);
- SkReadBuffer reader(written, writer.bytesWritten());
+ SkReadBuffer reader(writer.getWriter32()->contiguousArray(), writer.bytesWritten());
SkPaint other;
- SkPaint::FlatteningTraits::Unflatten(reader, &other);
+ other.unflatten(reader);
ASSERT(reader.offset() == writer.bytesWritten());
// No matter the encoding, these must always hold.
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698