| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 uint8_t* bytes = dst.getAddr8(midX, midY); | 176 uint8_t* bytes = dst.getAddr8(midX, midY); |
| 177 int i; | 177 int i; |
| 178 for (i = 0; i < dst.fBounds.width()-(midX-dst.fBounds.fLeft); ++i) { | 178 for (i = 0; i < dst.fBounds.width()-(midX-dst.fBounds.fLeft); ++i) { |
| 179 if (i < resultCount) { | 179 if (i < resultCount) { |
| 180 result[i] = bytes[i]; | 180 result[i] = bytes[i]; |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 for ( ; i < resultCount; ++i) { | 183 for ( ; i < resultCount; ++i) { |
| 184 result[i] = 0; | 184 result[i] = 0; |
| 185 } | 185 } |
| 186 |
| 187 SkMask::FreeImage(src.fImage); |
| 188 SkMask::FreeImage(dst.fImage); |
| 186 } | 189 } |
| 187 | 190 |
| 188 // Implement a step function that is 255 between min and max; 0 elsewhere. | 191 // Implement a step function that is 255 between min and max; 0 elsewhere. |
| 189 static int step(int x, SkScalar min, SkScalar max) { | 192 static int step(int x, SkScalar min, SkScalar max) { |
| 190 if (min < x && x < max) { | 193 if (min < x && x < max) { |
| 191 return 255; | 194 return 255; |
| 192 } | 195 } |
| 193 return 0; | 196 return 0; |
| 194 } | 197 } |
| 195 | 198 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 382 |
| 380 /////////////////////////////////////////////////////////////////////////////// | 383 /////////////////////////////////////////////////////////////////////////////// |
| 381 | 384 |
| 382 static void test_blur(skiatest::Reporter* reporter, GrContextFactory* factory) { | 385 static void test_blur(skiatest::Reporter* reporter, GrContextFactory* factory) { |
| 383 test_blur_drawing(reporter); | 386 test_blur_drawing(reporter); |
| 384 test_sigma_range(reporter, factory); | 387 test_sigma_range(reporter, factory); |
| 385 } | 388 } |
| 386 | 389 |
| 387 #include "TestClassDef.h" | 390 #include "TestClassDef.h" |
| 388 DEFINE_GPUTESTCLASS("BlurMaskFilter", BlurTestClass, test_blur) | 391 DEFINE_GPUTESTCLASS("BlurMaskFilter", BlurTestClass, test_blur) |
| OLD | NEW |