diff options
author | mtklein <mtklein@chromium.org> | 2014-09-22 11:40:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-22 11:40:33 -0700 |
commit | ee902cd4f4b3c8f355c0f4de35152a14904ec54a (patch) | |
tree | 331746137ebc39d4e34a5b1f5ceff97c5567fa12 /tests/PaintTest.cpp | |
parent | baae2f1aa283a71e8047f6104d5d147d23111424 (diff) |
Make a flipped fDirtyBit always mean "this field is not the default".
Haven't been able to measure any perf effect, so I figure I'll let the bots have at it.
BUG=skia:
R=mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/595583003
Diffstat (limited to 'tests/PaintTest.cpp')
-rw-r--r-- | tests/PaintTest.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index 5106057728..57d028336a 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; |