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

Unified Diff: tests/BlurTest.cpp

Issue 1448873002: Generate list of GPU contexts outside tests (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-01-gpu-test-context-support
Patch Set: make blurtest for all rendering contexts Created 5 years, 1 month 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 | « no previous file | tests/ClipBoundsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
-}
« no previous file with comments | « no previous file | tests/ClipBoundsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698