| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 | 8 |
| 9 #include "Test.h" | 9 #include "Test.h" |
| 10 #include "SkBicubicImageFilter.h" | 10 #include "SkBicubicImageFilter.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 { | 102 { |
| 103 // Check that a color filter image filter without a crop rect can be | 103 // Check that a color filter image filter without a crop rect can be |
| 104 // expressed as a color filter. | 104 // expressed as a color filter. |
| 105 SkAutoTUnref<SkImageFilter> gray(make_grayscale()); | 105 SkAutoTUnref<SkImageFilter> gray(make_grayscale()); |
| 106 REPORTER_ASSERT(reporter, true == gray->asColorFilter(NULL)); | 106 REPORTER_ASSERT(reporter, true == gray->asColorFilter(NULL)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 { | 109 { |
| 110 // Check that a color filter image filter with a crop rect cannot | 110 // Check that a color filter image filter with a crop rect cannot |
| 111 // be expressed as a color filter. | 111 // be expressed as a color filter. |
| 112 #ifdef SK_CROP_RECT_IS_INT | |
| 113 SkIRect cropRect = SkIRect::MakeXYWH(0, 0, 100, 100); | |
| 114 #else | |
| 115 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(0, 0, 100, 100)); | 112 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(0, 0, 100, 100)); |
| 116 #endif | |
| 117 SkAutoTUnref<SkImageFilter> grayWithCrop(make_grayscale(NULL, &cropR
ect)); | 113 SkAutoTUnref<SkImageFilter> grayWithCrop(make_grayscale(NULL, &cropR
ect)); |
| 118 REPORTER_ASSERT(reporter, false == grayWithCrop->asColorFilter(NULL)
); | 114 REPORTER_ASSERT(reporter, false == grayWithCrop->asColorFilter(NULL)
); |
| 119 } | 115 } |
| 120 | 116 |
| 121 { | 117 { |
| 122 // Tests pass by not asserting | 118 // Tests pass by not asserting |
| 123 SkBitmap bitmap, result; | 119 SkBitmap bitmap, result; |
| 124 make_small_bitmap(bitmap); | 120 make_small_bitmap(bitmap); |
| 125 result.setConfig(SkBitmap::kARGB_8888_Config, kBitmapSize, kBitmapSi
ze); | 121 result.setConfig(SkBitmap::kARGB_8888_Config, kBitmapSize, kBitmapSi
ze); |
| 126 result.allocPixels(); | 122 result.allocPixels(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 REPORTER_ASSERT(reporter, | 154 REPORTER_ASSERT(reporter, |
| 159 !bicubic->filterImage(&proxy, bitmap, SkMatrix::I(), &result
, &loc)); | 155 !bicubic->filterImage(&proxy, bitmap, SkMatrix::I(), &result
, &loc)); |
| 160 } | 156 } |
| 161 } | 157 } |
| 162 } | 158 } |
| 163 }; | 159 }; |
| 164 | 160 |
| 165 | 161 |
| 166 #include "TestClassDef.h" | 162 #include "TestClassDef.h" |
| 167 DEFINE_TESTCLASS("ImageFilterTest", ImageFilterTestClass, ImageFilterTest::Test) | 163 DEFINE_TESTCLASS("ImageFilterTest", ImageFilterTestClass, ImageFilterTest::Test) |
| OLD | NEW |