| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 polyPath.addPoly(polyPts, SK_ARRAY_COUNT(polyPts), true); | 342 polyPath.addPoly(polyPts, SK_ARRAY_COUNT(polyPts), true); |
| 343 | 343 |
| 344 int rectSpecialCaseResult[kSize]; | 344 int rectSpecialCaseResult[kSize]; |
| 345 int generalCaseResult[kSize]; | 345 int generalCaseResult[kSize]; |
| 346 #if SK_SUPPORT_GPU | 346 #if SK_SUPPORT_GPU |
| 347 int gpuResult[kSize]; | 347 int gpuResult[kSize]; |
| 348 #endif | 348 #endif |
| 349 int groundTruthResult[kSize]; | 349 int groundTruthResult[kSize]; |
| 350 int bruteForce1DResult[kSize]; | 350 int bruteForce1DResult[kSize]; |
| 351 | 351 |
| 352 SkScalar sigma = SkFloatToScalar(10.0f); | 352 SkScalar sigma = 10.0f; |
| 353 | 353 |
| 354 for (int i = 0; i < 4; ++i, sigma /= 10) { | 354 for (int i = 0; i < 4; ++i, sigma /= 10) { |
| 355 | 355 |
| 356 cpu_blur_path(rectPath, sigma, rectSpecialCaseResult, kSize); | 356 cpu_blur_path(rectPath, sigma, rectSpecialCaseResult, kSize); |
| 357 cpu_blur_path(polyPath, sigma, generalCaseResult, kSize); | 357 cpu_blur_path(polyPath, sigma, generalCaseResult, kSize); |
| 358 #if SK_SUPPORT_GPU | 358 #if SK_SUPPORT_GPU |
| 359 bool haveGPUResult = gpu_blur_path(factory, rectPath, sigma, gpuResult,
kSize); | 359 bool haveGPUResult = gpu_blur_path(factory, rectPath, sigma, gpuResult,
kSize); |
| 360 #endif | 360 #endif |
| 361 ground_truth_2d(100, 100, sigma, groundTruthResult, kSize); | 361 ground_truth_2d(100, 100, sigma, groundTruthResult, kSize); |
| 362 brute_force_1d(-50.0f, 50.0f, sigma, bruteForce1DResult, kSize); | 362 brute_force_1d(-50.0f, 50.0f, sigma, bruteForce1DResult, kSize); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 385 | 385 |
| 386 /////////////////////////////////////////////////////////////////////////////// | 386 /////////////////////////////////////////////////////////////////////////////// |
| 387 | 387 |
| 388 static void test_blur(skiatest::Reporter* reporter, GrContextFactory* factory) { | 388 static void test_blur(skiatest::Reporter* reporter, GrContextFactory* factory) { |
| 389 test_blur_drawing(reporter); | 389 test_blur_drawing(reporter); |
| 390 test_sigma_range(reporter, factory); | 390 test_sigma_range(reporter, factory); |
| 391 } | 391 } |
| 392 | 392 |
| 393 #include "TestClassDef.h" | 393 #include "TestClassDef.h" |
| 394 DEFINE_GPUTESTCLASS("BlurMaskFilter", BlurTestClass, test_blur) | 394 DEFINE_GPUTESTCLASS("BlurMaskFilter", BlurTestClass, test_blur) |
| OLD | NEW |