diff options
author | reed <reed@google.com> | 2015-03-16 10:08:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-16 10:08:34 -0700 |
commit | 93a1215fe0ab007ce941c721f1fd3e9dcb5d4754 (patch) | |
tree | d6dfbb67e08a7f3163008787a10c1ec9b492e291 /tests | |
parent | 903dcb08b146cbaf81420a734a64692038b467ca (diff) |
SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/
BUG=skia:
TBR=scroggo@google.com
Review URL: https://codereview.chromium.org/1014533004
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 12 | ||||
-rw-r--r-- | tests/ImageFilterTest.cpp | 6 | ||||
-rw-r--r-- | tests/PaintTest.cpp | 38 | ||||
-rw-r--r-- | tests/SkResourceCacheTest.cpp | 2 |
4 files changed, 28 insertions, 30 deletions
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 1ecc590e53..9203879a9e 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -46,17 +46,17 @@ static void test_faulty_pixelref(skiatest::Reporter* reporter) { SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(200, 200)); SkCanvas* canvas = surface->getCanvas(); - const SkPaint::FilterLevel levels[] = { - SkPaint::kNone_FilterLevel, - SkPaint::kLow_FilterLevel, - SkPaint::kMedium_FilterLevel, - SkPaint::kHigh_FilterLevel, + const SkFilterQuality levels[] = { + kNone_SkFilterQuality, + kLow_SkFilterQuality, + kMedium_SkFilterQuality, + kHigh_SkFilterQuality, }; SkPaint paint; canvas->scale(2, 2); // need a scale, otherwise we may ignore filtering for (size_t i = 0; i < SK_ARRAY_COUNT(levels); ++i) { - paint.setFilterLevel(levels[i]); + paint.setFilterQuality(levels[i]); canvas->drawBitmap(bm, 0, 0, &paint); } } diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 5e92ee35f7..7d7d474b30 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -470,7 +470,7 @@ DEF_TEST(ImageFilterDrawTiled, reporter) { { "erode", SkErodeImageFilter::Create(2, 3) }, { "tile", SkTileImageFilter::Create(SkRect::MakeXYWH(0, 0, 50, 50), SkRect::MakeXYWH(0, 0, 100, 100), NULL) }, - { "matrix", SkMatrixImageFilter::Create(matrix, SkPaint::kLow_FilterLevel) }, + { "matrix", SkMatrixImageFilter::Create(matrix, kLow_SkFilterQuality) }, { "blur and offset", SkOffsetImageFilter::Create(five, five, blur.get()) }, { "picture and blur", SkBlurImageFilter::Create(five, five, pictureFilter.get()) }, { "rect shader and blur", SkBlurImageFilter::Create(five, five, rectShaderFilter.get()) }, @@ -533,7 +533,7 @@ static void draw_saveLayer_picture(int width, int height, int tileSize, SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorWHITE, SkXfermode::kSrc_Mode)); SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get())); - SkAutoTUnref<SkImageFilter> imageFilter(SkMatrixImageFilter::Create(matrix, SkPaint::kNone_FilterLevel, cfif.get())); + SkAutoTUnref<SkImageFilter> imageFilter(SkMatrixImageFilter::Create(matrix, kNone_SkFilterQuality, cfif.get())); SkPaint paint; paint.setImageFilter(imageFilter.get()); @@ -1076,7 +1076,7 @@ DEF_TEST(ImageFilterNestedSaveLayer, reporter) { matrix.setScale(SkIntToScalar(2), SkIntToScalar(2)); matrix.postTranslate(SkIntToScalar(-20), SkIntToScalar(-20)); SkAutoTUnref<SkImageFilter> matrixFilter( - SkMatrixImageFilter::Create(matrix, SkPaint::kLow_FilterLevel)); + SkMatrixImageFilter::Create(matrix, kLow_SkFilterQuality)); // Test that saveLayer() with a filter nested inside another saveLayer() applies the // correct offset to the filter matrix. diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index bf22de1daf..1fca8dc656 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -116,27 +116,25 @@ DEF_TEST(Paint_cmap, reporter) { } // temparary api for bicubic, just be sure we can set/clear it -DEF_TEST(Paint_filterlevel, reporter) { +DEF_TEST(Paint_filterQuality, reporter) { SkPaint p0, p1; - REPORTER_ASSERT(reporter, - SkPaint::kNone_FilterLevel == p0.getFilterLevel()); + REPORTER_ASSERT(reporter, kNone_SkFilterQuality == p0.getFilterQuality()); - static const SkPaint::FilterLevel gLevels[] = { - SkPaint::kNone_FilterLevel, - SkPaint::kLow_FilterLevel, - SkPaint::kMedium_FilterLevel, - SkPaint::kHigh_FilterLevel + static const SkFilterQuality gQualitys[] = { + kNone_SkFilterQuality, + kLow_SkFilterQuality, + kMedium_SkFilterQuality, + kHigh_SkFilterQuality }; - for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) { - p0.setFilterLevel(gLevels[i]); - REPORTER_ASSERT(reporter, gLevels[i] == p0.getFilterLevel()); + for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) { + p0.setFilterQuality(gQualitys[i]); + REPORTER_ASSERT(reporter, gQualitys[i] == p0.getFilterQuality()); p1 = p0; - REPORTER_ASSERT(reporter, gLevels[i] == p1.getFilterLevel()); + REPORTER_ASSERT(reporter, gQualitys[i] == p1.getFilterQuality()); p0.reset(); - REPORTER_ASSERT(reporter, - SkPaint::kNone_FilterLevel == p0.getFilterLevel()); + REPORTER_ASSERT(reporter, kNone_SkFilterQuality == p0.getFilterQuality()); } } @@ -205,11 +203,11 @@ DEF_TEST(Paint_regression_cubic, reporter) { } DEF_TEST(Paint_flattening, reporter) { - const SkPaint::FilterLevel levels[] = { - SkPaint::kNone_FilterLevel, - SkPaint::kLow_FilterLevel, - SkPaint::kMedium_FilterLevel, - SkPaint::kHigh_FilterLevel, + const SkFilterQuality levels[] = { + kNone_SkFilterQuality, + kLow_SkFilterQuality, + kMedium_SkFilterQuality, + kHigh_SkFilterQuality, }; const SkPaint::Hinting hinting[] = { SkPaint::kNo_Hinting, @@ -251,7 +249,7 @@ DEF_TEST(Paint_flattening, reporter) { SkPaint paint; paint.setFlags(0x1234); - FOR_SETUP(i, levels, setFilterLevel) + FOR_SETUP(i, levels, setFilterQuality) FOR_SETUP(j, hinting, setHinting) FOR_SETUP(k, align, setTextAlign) FOR_SETUP(l, caps, setStrokeCap) diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp index fae0816305..bb12d667ee 100644 --- a/tests/SkResourceCacheTest.cpp +++ b/tests/SkResourceCacheTest.cpp @@ -39,7 +39,7 @@ static bool test_scaled_image_cache_usage() { SkScalar yScaledSize = SkIntToScalar(kBitmapSize) * yScale; canvas->clipRect(SkRect::MakeLTRB(0, 0, xScaledSize, yScaledSize)); SkPaint paint; - paint.setFilterLevel(SkPaint::kHigh_FilterLevel); + paint.setFilterQuality(kHigh_SkFilterQuality); canvas->drawBitmapRect(bitmap, SkRect::MakeLTRB(0, 0, xScaledSize, yScaledSize), |