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

Unified Diff: tests/PaintTest.cpp

Issue 595583003: Make a flipped fDirtyBit always mean "this field is not the default". (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/SkPaint.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 51060577284c4dbc96643c1be033d08a48a710dc..57d028336aa3431947f5bdbbdad7e65b30e5e2d9 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -318,19 +318,22 @@ DEF_TEST(Paint_regression_measureText, reporter) {
DEF_TEST(Paint_FlatteningTraits, r) {
SkPaint paint;
paint.setColor(0x00AABBCC);
- paint.setTextScaleX(1.0f); // Encoded despite being the default value.
+ paint.setTextScaleX(1.0f); // Default value, ignored.
paint.setTextSize(19);
paint.setXfermode(SkXfermode::Create(SkXfermode::kModulate_Mode))->unref();
- paint.setLooper(NULL); // Ignored.
+ paint.setLooper(NULL); // Default value, ignored.
SkWriteBuffer writer;
SkPaint::FlatteningTraits::Flatten(writer, paint);
- const size_t expectedBytesWritten = sizeof(void*) == 8 ? 36 : 32;
- ASSERT(expectedBytesWritten == writer.bytesWritten());
- const uint32_t* written = writer.getWriter32()->contiguousArray();
- SkASSERT(written != NULL);
- ASSERT(*written == ((1<<0) | (1<<1) | (1<<2) | (1<<8))); // Dirty bits for our 4.
+ // 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
SkReadBuffer reader(written, writer.bytesWritten());
SkPaint other;
« no previous file with comments | « src/core/SkPaint.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698