diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-22 17:18:18 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-22 17:18:18 +0000 |
commit | 9cfc83cc8ac2ee50a7ce889e65a707941f48bdea (patch) | |
tree | 879cd1f934857a2f296d5fe9c5dbf190af1f40af /tests/PaintTest.cpp | |
parent | 35f02fb9c9f548656e1cb2cc66d3ed20006384f8 (diff) |
stop using bitmap-filter flags outside of paint itself, as a step towards really changing them into an enum
BUG=
Review URL: https://codereview.chromium.org/19825002
git-svn-id: http://skia.googlecode.com/svn/trunk@10240 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/PaintTest.cpp')
-rw-r--r-- | tests/PaintTest.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index 5631632bdb..dc131f20e2 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -109,17 +109,28 @@ static void test_cmap(skiatest::Reporter* reporter) { } // temparary api for bicubic, just be sure we can set/clear it -static void test_bicubic(skiatest::Reporter* reporter) { - SkPaint p0; - REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitmap_Flag)); - p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); - REPORTER_ASSERT(reporter, 0 != (p0.getFlags() & SkPaint::kBicubicFilterBitmap_Flag)); - SkPaint p1(p0); - REPORTER_ASSERT(reporter, 0 != (p1.getFlags() & SkPaint::kBicubicFilterBitmap_Flag)); - p0.reset(); - REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitmap_Flag)); - p0 = p1; - p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); +static void test_filterlevel(skiatest::Reporter* reporter) { + SkPaint p0, p1; + + REPORTER_ASSERT(reporter, + SkPaint::kNone_FilterLevel == p0.getFilterLevel()); + + static const SkPaint::FilterLevel gLevels[] = { + SkPaint::kNone_FilterLevel, + SkPaint::kLow_FilterLevel, + SkPaint::kMedium_FilterLevel, + SkPaint::kHigh_FilterLevel + }; + for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) { + p0.setFilterLevel(gLevels[i]); + REPORTER_ASSERT(reporter, gLevels[i] == p0.getFilterLevel()); + p1 = p0; + REPORTER_ASSERT(reporter, gLevels[i] == p1.getFilterLevel()); + + p0.reset(); + REPORTER_ASSERT(reporter, + SkPaint::kNone_FilterLevel == p0.getFilterLevel()); + } } static void test_copy(skiatest::Reporter* reporter) { @@ -230,7 +241,7 @@ static void TestPaint(skiatest::Reporter* reporter) { regression_cubic(reporter); regression_measureText(reporter); - test_bicubic(reporter); + test_filterlevel(reporter); // need to implement charsToGlyphs on other backends (e.g. linux, win) // before we can run this tests everywhere |