Address some more valgrind issues
R=borenet@google.com
Review URL: https://codereview.chromium.org/59713010
git-svn-id: http://skia.googlecode.com/svn/trunk@12286 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index 97e267e..9c40aa7 100644
--- a/tests/BlurTest.cpp
+++ b/tests/BlurTest.cpp
@@ -273,13 +273,13 @@
}
#if SK_SUPPORT_GPU
-static void gpu_blur_path(GrContextFactory* factory, const SkPath& path,
+static bool gpu_blur_path(GrContextFactory* factory, const SkPath& path,
SkScalar gaussianSigma,
int* result, int resultCount) {
GrContext* grContext = factory->get(GrContextFactory::kNative_GLContextType);
if (NULL == grContext) {
- return;
+ return false;
}
GrTextureDesc desc;
@@ -295,6 +295,7 @@
blur_path(&canvas, path, gaussianSigma);
readback(&canvas, result, resultCount);
+ return true;
}
#endif
@@ -355,7 +356,7 @@
cpu_blur_path(rectPath, sigma, rectSpecialCaseResult, kSize);
cpu_blur_path(polyPath, sigma, generalCaseResult, kSize);
#if SK_SUPPORT_GPU
- gpu_blur_path(factory, rectPath, sigma, gpuResult, kSize);
+ bool haveGPUResult = gpu_blur_path(factory, rectPath, sigma, gpuResult, kSize);
#endif
ground_truth_2d(100, 100, sigma, groundTruthResult, kSize);
brute_force_1d(-50.0f, 50.0f, sigma, bruteForce1DResult, kSize);
@@ -363,8 +364,10 @@
REPORTER_ASSERT(reporter, match(rectSpecialCaseResult, bruteForce1DResult, kSize, 5));
REPORTER_ASSERT(reporter, match(generalCaseResult, bruteForce1DResult, kSize, 15));
#if SK_SUPPORT_GPU
- // 1 works everywhere but: Ubuntu13 & Nexus4
- REPORTER_ASSERT(reporter, match(gpuResult, bruteForce1DResult, kSize, 10));
+ if (haveGPUResult) {
+ // 1 works everywhere but: Ubuntu13 & Nexus4
+ REPORTER_ASSERT(reporter, match(gpuResult, bruteForce1DResult, kSize, 10));
+ }
#endif
REPORTER_ASSERT(reporter, match(groundTruthResult, bruteForce1DResult, kSize, 1));