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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL); | 1134 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL); |
1135 REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, &
result, &offset)); | 1135 REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, &
result, &offset)); |
1136 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); | 1136 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); |
1137 } | 1137 } |
1138 | 1138 |
1139 #if SK_SUPPORT_GPU | 1139 #if SK_SUPPORT_GPU |
1140 const SkSurfaceProps gProps = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_Ini
tType); | 1140 const SkSurfaceProps gProps = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_Ini
tType); |
1141 | 1141 |
1142 DEF_GPUTEST(ImageFilterCropRectGPU, reporter, factory) { | 1142 DEF_GPUTEST(ImageFilterCropRectGPU, reporter, factory) { |
1143 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 1143 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 1144 if (NULL == context) { |
| 1145 return; |
| 1146 } |
1144 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1147 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1145 SkSurface::kNo_Budgeted
, | 1148 SkSurface::kNo_Budgeted
, |
1146 SkImageInfo::MakeN32Pre
mul(100, 100), | 1149 SkImageInfo::MakeN32Pre
mul(100, 100), |
1147 0, | 1150 0, |
1148 &gProps)); | 1151 &gProps)); |
1149 test_crop_rects(device, reporter); | 1152 test_crop_rects(device, reporter); |
1150 } | 1153 } |
1151 | 1154 |
1152 DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { | 1155 DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { |
1153 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 1156 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 1157 if (NULL == context) { |
| 1158 return; |
| 1159 } |
1154 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1160 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1155 SkSurface::kNo_Budgeted
, | 1161 SkSurface::kNo_Budgeted
, |
1156 SkImageInfo::MakeN32Pre
mul(100, 100), | 1162 SkImageInfo::MakeN32Pre
mul(100, 100), |
1157 0, | 1163 0, |
1158 &gProps)); | 1164 &gProps)); |
1159 test_huge_blur(device, reporter); | 1165 test_huge_blur(device, reporter); |
1160 } | 1166 } |
1161 | 1167 |
1162 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { | 1168 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { |
1163 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 1169 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 1170 if (NULL == context) { |
| 1171 return; |
| 1172 } |
1164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1173 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1165 SkSurface::kNo_Budgeted
, | 1174 SkSurface::kNo_Budgeted
, |
1166 SkImageInfo::MakeN32Pre
mul(1, 1), | 1175 SkImageInfo::MakeN32Pre
mul(1, 1), |
1167 0, | 1176 0, |
1168 &gProps)); | 1177 &gProps)); |
1169 test_xfermode_cropped_input(device, reporter); | 1178 test_xfermode_cropped_input(device, reporter); |
1170 } | 1179 } |
1171 | 1180 |
1172 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { | 1181 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { |
1173 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 1182 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 1183 if (NULL == context) { |
| 1184 return; |
| 1185 } |
1174 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1186 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1175 SkSurface::kNo_Budgeted
, | 1187 SkSurface::kNo_Budgeted
, |
1176 SkImageInfo::MakeN32Pre
mul(1, 1), | 1188 SkImageInfo::MakeN32Pre
mul(1, 1), |
1177 0, | 1189 0, |
1178 &gProps)); | 1190 &gProps)); |
1179 test_negative_blur_sigma(device, reporter); | 1191 test_negative_blur_sigma(device, reporter); |
1180 } | 1192 } |
1181 #endif | 1193 #endif |
OLD | NEW |