Index: tests/BlurTest.cpp |
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp |
index 89f3a0a5cf69cfe06ce09336f9d8e07d0e08ea4a..f5bb215065dba8b25902719ba57ea43a4f18b656 100644 |
--- a/tests/BlurTest.cpp |
+++ b/tests/BlurTest.cpp |
@@ -99,8 +99,7 @@ static bool compare(const SkBitmap& ref, const SkIRect& iref, |
return true; |
} |
-static void test_blur_drawing(skiatest::Reporter* reporter) { |
- |
+DEF_TEST(BlurDrawing, reporter) { |
SkPaint paint; |
paint.setColor(SK_ColorGRAY); |
paint.setStyle(SkPaint::kStroke_Style); |
@@ -276,15 +275,9 @@ static void cpu_blur_path(const SkPath& path, SkScalar gaussianSigma, |
#if SK_SUPPORT_GPU |
#if 0 |
// temporary disable; see below for explanation |
-static bool gpu_blur_path(GrContextFactory* factory, const SkPath& path, |
+static bool gpu_blur_path(GrContext* context, const SkPath& path, |
SkScalar gaussianSigma, |
int* result, int resultCount) { |
- |
- GrContext* grContext = factory->get(GrContextFactory::kNative_GLContextType); |
- if (nullptr == grContext) { |
- return false; |
- } |
- |
GrSurfaceDesc desc; |
desc.fConfig = kSkia8888_GrPixelConfig; |
desc.fFlags = kRenderTarget_GrSurfaceFlag; |
@@ -326,8 +319,7 @@ static bool match(int* first, int* second, int count, int tol) { |
} |
// Test out the normal blur style with a wide range of sigmas |
-static void test_sigma_range(skiatest::Reporter* reporter, GrContextFactory* factory) { |
- |
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BlurSigmaRange, reporter, context) { |
static const int kSize = 100; |
// The geometry is offset a smidge to trigger: |
@@ -365,7 +357,7 @@ static void test_sigma_range(skiatest::Reporter* reporter, GrContextFactory* fac |
#if SK_SUPPORT_GPU |
#if 0 |
int gpuResult[kSize]; |
- bool haveGPUResult = gpu_blur_path(factory, rectPath, sigma, gpuResult, kSize); |
+ bool haveGPUResult = gpu_blur_path(context, rectPath, sigma, gpuResult, kSize); |
// Disabling this test for now -- I don't think it's a legit comparison. |
// Will continue to investigate this. |
if (haveGPUResult) { |
@@ -507,7 +499,7 @@ static void test_layerDrawLooper(skiatest::Reporter* reporter, SkMaskFilter* mf, |
test_delete_looper(reporter, builder.detachLooper(), sigma, style, quality, false); |
} |
-static void test_asABlur(skiatest::Reporter* reporter) { |
+DEF_TEST(BlurAsABlur, reporter) { |
const SkBlurStyle styles[] = { |
kNormal_SkBlurStyle, kSolid_SkBlurStyle, kOuter_SkBlurStyle, kInner_SkBlurStyle |
}; |
@@ -566,9 +558,3 @@ static void test_asABlur(skiatest::Reporter* reporter) { |
} |
/////////////////////////////////////////////////////////////////////////////////////////// |
- |
-DEF_GPUTEST(Blur, reporter, factory) { |
- test_blur_drawing(reporter); |
- test_sigma_range(reporter, factory); |
- test_asABlur(reporter); |
-} |