OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
10 #include "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // Check that two non-clipping color matrices concatenate into a single
filter. | 145 // Check that two non-clipping color matrices concatenate into a single
filter. |
146 SkAutoTUnref<SkImageFilter> halfBrightness(make_scale(0.5f)); | 146 SkAutoTUnref<SkImageFilter> halfBrightness(make_scale(0.5f)); |
147 SkAutoTUnref<SkImageFilter> quarterBrightness(make_scale(0.5f, halfBrigh
tness)); | 147 SkAutoTUnref<SkImageFilter> quarterBrightness(make_scale(0.5f, halfBrigh
tness)); |
148 REPORTER_ASSERT(reporter, NULL == quarterBrightness->getInput(0)); | 148 REPORTER_ASSERT(reporter, NULL == quarterBrightness->getInput(0)); |
149 } | 149 } |
150 | 150 |
151 { | 151 { |
152 // Check that a clipping color matrix followed by a grayscale does not c
oncatenate into a single filter. | 152 // Check that a clipping color matrix followed by a grayscale does not c
oncatenate into a single filter. |
153 SkAutoTUnref<SkImageFilter> doubleBrightness(make_scale(2.0f)); | 153 SkAutoTUnref<SkImageFilter> doubleBrightness(make_scale(2.0f)); |
154 SkAutoTUnref<SkImageFilter> halfBrightness(make_scale(0.5f, doubleBright
ness)); | 154 SkAutoTUnref<SkImageFilter> halfBrightness(make_scale(0.5f, doubleBright
ness)); |
155 REPORTER_ASSERT(reporter, NULL != halfBrightness->getInput(0)); | 155 REPORTER_ASSERT(reporter, halfBrightness->getInput(0)); |
156 } | 156 } |
157 | 157 |
158 { | 158 { |
159 // Check that a color filter image filter without a crop rect can be | 159 // Check that a color filter image filter without a crop rect can be |
160 // expressed as a color filter. | 160 // expressed as a color filter. |
161 SkAutoTUnref<SkImageFilter> gray(make_grayscale()); | 161 SkAutoTUnref<SkImageFilter> gray(make_grayscale()); |
162 REPORTER_ASSERT(reporter, true == gray->asColorFilter(NULL)); | 162 REPORTER_ASSERT(reporter, true == gray->asColorFilter(NULL)); |
163 } | 163 } |
164 | 164 |
165 { | 165 { |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 } | 960 } |
961 | 961 |
962 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { | 962 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { |
963 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 963 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
964 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 964 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
965 SkImageInfo::MakeN32Pre
mul(1, 1), | 965 SkImageInfo::MakeN32Pre
mul(1, 1), |
966 0)); | 966 0)); |
967 test_xfermode_cropped_input(device, reporter); | 967 test_xfermode_cropped_input(device, reporter); |
968 } | 968 } |
969 #endif | 969 #endif |
OLD | NEW |