Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "SkBlurImageFilter.h" 11 #include "SkBlurImageFilter.h"
12 #include "SkCanvas.h" 12 #include "SkCanvas.h"
13 #include "SkColorFilterImageFilter.h" 13 #include "SkColorFilterImageFilter.h"
14 #include "SkColorMatrixFilter.h" 14 #include "SkColorMatrixFilter.h"
15 #include "SkComposeImageFilter.h" 15 #include "SkComposeImageFilter.h"
16 #include "SkDeviceImageFilterProxy.h" 16 #include "SkDeviceImageFilterProxy.h"
17 #include "SkDisplacementMapEffect.h" 17 #include "SkDisplacementMapEffect.h"
18 #include "SkDropShadowImageFilter.h" 18 #include "SkDropShadowImageFilter.h"
19 #include "SkFlattenableSerialization.h" 19 #include "SkFlattenableSerialization.h"
20 #include "SkGradientShader.h" 20 #include "SkGradientShader.h"
21 #include "SkImagePriv.h"
22 #include "SkImage_Base.h"
21 #include "SkLightingImageFilter.h" 23 #include "SkLightingImageFilter.h"
22 #include "SkMatrixConvolutionImageFilter.h" 24 #include "SkMatrixConvolutionImageFilter.h"
23 #include "SkMatrixImageFilter.h" 25 #include "SkMatrixImageFilter.h"
24 #include "SkMergeImageFilter.h" 26 #include "SkMergeImageFilter.h"
25 #include "SkMorphologyImageFilter.h" 27 #include "SkMorphologyImageFilter.h"
26 #include "SkOffsetImageFilter.h" 28 #include "SkOffsetImageFilter.h"
27 #include "SkPerlinNoiseShader.h" 29 #include "SkPerlinNoiseShader.h"
28 #include "SkPicture.h" 30 #include "SkPicture.h"
29 #include "SkPictureImageFilter.h" 31 #include "SkPictureImageFilter.h"
30 #include "SkPictureRecorder.h" 32 #include "SkPictureRecorder.h"
(...skipping 12 matching lines...) Expand all
43 static const int kBitmapSize = 4; 45 static const int kBitmapSize = 4;
44 46
45 namespace { 47 namespace {
46 48
47 class MatrixTestImageFilter : public SkImageFilter { 49 class MatrixTestImageFilter : public SkImageFilter {
48 public: 50 public:
49 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected Matrix) 51 MatrixTestImageFilter(skiatest::Reporter* reporter, const SkMatrix& expected Matrix)
50 : SkImageFilter(0, NULL), fReporter(reporter), fExpectedMatrix(expectedMat rix) { 52 : SkImageFilter(0, NULL), fReporter(reporter), fExpectedMatrix(expectedMat rix) {
51 } 53 }
52 54
53 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, 55 virtual bool onFilterImage(Proxy*, const SkImage* src, const Context& ctx,
54 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE { 56 SkAutoTUnref<const SkImage>& result, SkIPoint* of fset) const SK_OVERRIDE {
55 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); 57 REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix);
58 result.reset(SkRef(src));
56 return true; 59 return true;
57 } 60 }
58 61
59 SK_TO_STRING_OVERRIDE() 62 SK_TO_STRING_OVERRIDE()
60 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) 63 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter)
61 64
62 protected: 65 protected:
63 void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { 66 void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
64 this->INHERITED::flatten(buffer); 67 this->INHERITED::flatten(buffer);
65 buffer.writeFunctionPtr(fReporter); 68 buffer.writeFunctionPtr(fReporter);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 SkIntToScalar(kBitmapSize)); 230 SkIntToScalar(kBitmapSize));
228 canvas.drawRect(r, paint); 231 canvas.drawRect(r, paint);
229 } 232 }
230 } 233 }
231 } 234 }
232 235
233 static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter) { 236 static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter) {
234 // Check that all filters offset to their absolute crop rect, 237 // Check that all filters offset to their absolute crop rect,
235 // unaffected by the input crop rect. 238 // unaffected by the input crop rect.
236 // Tests pass by not asserting. 239 // Tests pass by not asserting.
237 SkBitmap bitmap; 240 SkAutoTUnref<SkImage> image;
238 bitmap.allocN32Pixels(100, 100); 241 {
239 bitmap.eraseARGB(0, 0, 0, 0); 242 SkBitmap bitmap;
243 bitmap.allocN32Pixels(100, 100);
244 bitmap.eraseARGB(0, 0, 0, 0);
245 image.reset(SkNewImageFromBitmap(bitmap, NULL));
246 REPORTER_ASSERT(reporter, image != NULL);
247 }
240 SkDeviceImageFilterProxy proxy(device, SkSurfaceProps(SkSurfaceProps::kLegac yFontHost_InitType)); 248 SkDeviceImageFilterProxy proxy(device, SkSurfaceProps(SkSurfaceProps::kLegac yFontHost_InitType));
241 249
242 SkImageFilter::CropRect inputCropRect(SkRect::MakeXYWH(8, 13, 80, 80)); 250 SkImageFilter::CropRect inputCropRect(SkRect::MakeXYWH(8, 13, 80, 80));
243 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(20, 30, 60, 60)); 251 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(20, 30, 60, 60));
244 SkAutoTUnref<SkImageFilter> input(make_grayscale(NULL, &inputCropRect)); 252 SkAutoTUnref<SkImageFilter> input(make_grayscale(NULL, &inputCropRect));
245 253
246 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode)); 254 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorRED, SkXfermode::kSrcIn_Mode));
247 SkPoint3 location(0, 0, SK_Scalar1); 255 SkPoint3 location(0, 0, SK_Scalar1);
248 SkPoint3 target(SK_Scalar1, SK_Scalar1, SK_Scalar1); 256 SkPoint3 target(SK_Scalar1, SK_Scalar1, SK_Scalar1);
249 SkScalar kernel[9] = { 257 SkScalar kernel[9] = {
(...skipping 20 matching lines...) Expand all
270 SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRe ct), 278 SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRe ct),
271 SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRe ct), 279 SkOffsetImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRe ct),
272 SkDilateImageFilter::Create(3, 2, input.get(), &cropRect), 280 SkDilateImageFilter::Create(3, 2, input.get(), &cropRect),
273 SkErodeImageFilter::Create(2, 3, input.get(), &cropRect), 281 SkErodeImageFilter::Create(2, 3, input.get(), &cropRect),
274 SkTileImageFilter::Create(inputCropRect.rect(), cropRect.rect(), input.g et()), 282 SkTileImageFilter::Create(inputCropRect.rect(), cropRect.rect(), input.g et()),
275 SkXfermodeImageFilter::Create(SkXfermode::Create(SkXfermode::kSrcOver_Mo de), input.get(), input.get(), &cropRect), 283 SkXfermodeImageFilter::Create(SkXfermode::Create(SkXfermode::kSrcOver_Mo de), input.get(), input.get(), &cropRect),
276 }; 284 };
277 285
278 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) { 286 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) {
279 SkImageFilter* filter = filters[i]; 287 SkImageFilter* filter = filters[i];
280 SkBitmap result; 288 SkAutoTUnref<const SkImage> result;
281 SkIPoint offset; 289 SkIPoint offset;
282 SkString str; 290 SkString str;
283 str.printf("filter %d", static_cast<int>(i)); 291 str.printf("filter %d", static_cast<int>(i));
284 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL); 292 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL);
285 REPORTER_ASSERT_MESSAGE(reporter, filter->filterImage(&proxy, bitmap, ct x, 293 REPORTER_ASSERT_MESSAGE(reporter, filter->filterImage(&proxy, image, ctx ,
286 &result, &offset), str.c_str()); 294 result, &offset), str.c_str());
287 REPORTER_ASSERT_MESSAGE(reporter, offset.fX == 20 && offset.fY == 30, st r.c_str()); 295 REPORTER_ASSERT_MESSAGE(reporter, offset.fX == 20 && offset.fY == 30, st r.c_str());
288 } 296 }
289 297
290 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) { 298 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) {
291 SkSafeUnref(filters[i]); 299 SkSafeUnref(filters[i]);
292 } 300 }
293 } 301 }
294 302
295 static SkBitmap make_gradient_circle(int width, int height) { 303 static SkBitmap make_gradient_circle(int width, int height) {
296 SkBitmap bitmap; 304 SkBitmap bitmap;
297 SkScalar x = SkIntToScalar(width / 2); 305 SkScalar x = SkIntToScalar(width / 2);
298 SkScalar y = SkIntToScalar(height / 2); 306 SkScalar y = SkIntToScalar(height / 2);
299 SkScalar radius = SkMinScalar(x, y) * 0.8f; 307 SkScalar radius = SkMinScalar(x, y) * 0.8f;
300 bitmap.allocN32Pixels(width, height); 308 bitmap.allocN32Pixels(width, height);
301 SkCanvas canvas(bitmap); 309 SkCanvas canvas(bitmap);
302 canvas.clear(0x00000000); 310 canvas.clear(0x00000000);
303 SkColor colors[2]; 311 SkColor colors[2];
304 colors[0] = SK_ColorWHITE; 312 colors[0] = SK_ColorWHITE;
305 colors[1] = SK_ColorBLACK; 313 colors[1] = SK_ColorBLACK;
306 SkAutoTUnref<SkShader> shader( 314 SkAutoTUnref<SkShader> shader(
307 SkGradientShader::CreateRadial(SkPoint::Make(x, y), radius, colors, NULL , 2, 315 SkGradientShader::CreateRadial(SkPoint::Make(x, y), radius, colors, NULL , 2,
308 SkShader::kClamp_TileMode) 316 SkShader::kClamp_TileMode)
309 ); 317 );
310 SkPaint paint; 318 SkPaint paint;
311 paint.setShader(shader); 319 paint.setShader(shader);
312 canvas.drawCircle(x, y, radius, paint); 320 canvas.drawCircle(x, y, radius, paint);
313 return bitmap; 321 return bitmap;
314 } 322 }
315 323
324
316 static void test_negative_blur_sigma(SkBaseDevice* device, skiatest::Reporter* r eporter) { 325 static void test_negative_blur_sigma(SkBaseDevice* device, skiatest::Reporter* r eporter) {
317 // Check that SkBlurImageFilter will accept a negative sigma, either in 326 // Check that SkBlurImageFilter will accept a negative sigma, either in
318 // the given arguments or after CTM application. 327 // the given arguments or after CTM application.
319 int width = 32, height = 32; 328 int width = 32, height = 32;
320 SkDeviceImageFilterProxy proxy(device, SkSurfaceProps(SkSurfaceProps::kLegac yFontHost_InitType)); 329 SkDeviceImageFilterProxy proxy(device, SkSurfaceProps(SkSurfaceProps::kLegac yFontHost_InitType));
321 SkScalar five = SkIntToScalar(5); 330 SkScalar five = SkIntToScalar(5);
322 331
323 SkAutoTUnref<SkBlurImageFilter> positiveFilter( 332 SkAutoTUnref<SkBlurImageFilter> positiveFilter(
324 SkBlurImageFilter::Create(five, five) 333 SkBlurImageFilter::Create(five, five)
325 ); 334 );
326 335
327 SkAutoTUnref<SkBlurImageFilter> negativeFilter( 336 SkAutoTUnref<SkBlurImageFilter> negativeFilter(
328 SkBlurImageFilter::Create(-five, five) 337 SkBlurImageFilter::Create(-five, five)
329 ); 338 );
330 339
331 SkBitmap gradient = make_gradient_circle(width, height);
332 SkBitmap positiveResult1, negativeResult1; 340 SkBitmap positiveResult1, negativeResult1;
333 SkBitmap positiveResult2, negativeResult2; 341 SkBitmap positiveResult2, negativeResult2;
334 SkIPoint offset; 342 {
335 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL); 343 SkAutoTUnref<SkImage> gradient(
336 positiveFilter->filterImage(&proxy, gradient, ctx, &positiveResult1, &offset ); 344 SkNewImageFromBitmap(make_gradient_circle(width, height), NULL));
337 negativeFilter->filterImage(&proxy, gradient, ctx, &negativeResult1, &offset ); 345 SkAutoTUnref<const SkImage> positiveResult1i, negativeResult1i;
338 SkMatrix negativeScale; 346 SkAutoTUnref<const SkImage> positiveResult2i, negativeResult2i;
339 negativeScale.setScale(-SK_Scalar1, SK_Scalar1); 347 SkIPoint offset;
340 SkImageFilter::Context negativeCTX(negativeScale, SkIRect::MakeLargest(), NU LL); 348 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL);
341 positiveFilter->filterImage(&proxy, gradient, negativeCTX, &negativeResult2, &offset); 349 positiveFilter->filterImage(&proxy, gradient, ctx, positiveResult1i, &of fset);
342 negativeFilter->filterImage(&proxy, gradient, negativeCTX, &positiveResult2, &offset); 350 negativeFilter->filterImage(&proxy, gradient, ctx, negativeResult1i, &of fset);
351 SkMatrix negativeScale;
352 negativeScale.setScale(-SK_Scalar1, SK_Scalar1);
353 SkImageFilter::Context negativeCTX(negativeScale, SkIRect::MakeLargest() , NULL);
354 positiveFilter->filterImage(&proxy, gradient, negativeCTX, negativeResul t2i, &offset);
355 negativeFilter->filterImage(&proxy, gradient, negativeCTX, positiveResul t2i, &offset);
356 REPORTER_ASSERT(reporter, as_IB(positiveResult1i)->getROPixels(&positive Result1));
357 REPORTER_ASSERT(reporter, as_IB(positiveResult2i)->getROPixels(&positive Result2));
358 REPORTER_ASSERT(reporter, as_IB(negativeResult1i)->getROPixels(&negative Result1));
359 REPORTER_ASSERT(reporter, as_IB(negativeResult2i)->getROPixels(&negative Result2));
360 }
361
343 SkAutoLockPixels lockP1(positiveResult1); 362 SkAutoLockPixels lockP1(positiveResult1);
344 SkAutoLockPixels lockP2(positiveResult2); 363 SkAutoLockPixels lockP2(positiveResult2);
345 SkAutoLockPixels lockN1(negativeResult1); 364 SkAutoLockPixels lockN1(negativeResult1);
346 SkAutoLockPixels lockN2(negativeResult2); 365 SkAutoLockPixels lockN2(negativeResult2);
347 for (int y = 0; y < height; y++) { 366 for (int y = 0; y < height; y++) {
348 int diffs = memcmp(positiveResult1.getAddr32(0, y), negativeResult1.getA ddr32(0, y), positiveResult1.rowBytes()); 367 int diffs = memcmp(positiveResult1.getAddr32(0, y), negativeResult1.getA ddr32(0, y), positiveResult1.rowBytes());
349 REPORTER_ASSERT(reporter, !diffs); 368 REPORTER_ASSERT(reporter, !diffs);
350 if (diffs) { 369 if (diffs) {
351 break; 370 break;
352 } 371 }
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 851
833 // Create an SkPicture which simply draws a green 1x1 rectangle. 852 // Create an SkPicture which simply draws a green 1x1 rectangle.
834 SkPaint greenPaint; 853 SkPaint greenPaint;
835 greenPaint.setColor(SK_ColorGREEN); 854 greenPaint.setColor(SK_ColorGREEN);
836 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeWH(1, 1)), greenPaint); 855 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeWH(1, 1)), greenPaint);
837 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); 856 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
838 857
839 SkAutoTUnref<SkImageFilter> imageFilter( 858 SkAutoTUnref<SkImageFilter> imageFilter(
840 SkPictureImageFilter::Create(picture.get())); 859 SkPictureImageFilter::Create(picture.get()));
841 860
842 SkBitmap result; 861 SkAutoTUnref<const SkImage> result;
843 SkIPoint offset; 862 SkIPoint offset;
844 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(1, 1, 1, 1), NUL L); 863 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(1, 1, 1, 1), NUL L);
864 SkAutoTUnref<const SkImage> image;
845 SkBitmap bitmap; 865 SkBitmap bitmap;
846 bitmap.allocN32Pixels(2, 2); 866 bitmap.allocN32Pixels(2, 2);
867 image.reset(SkNewImageFromBitmap(bitmap, NULL));
847 SkBitmapDevice device(bitmap); 868 SkBitmapDevice device(bitmap);
848 SkDeviceImageFilterProxy proxy(&device, SkSurfaceProps(SkSurfaceProps::kLega cyFontHost_InitType)); 869 SkDeviceImageFilterProxy proxy(&device, SkSurfaceProps(SkSurfaceProps::kLega cyFontHost_InitType));
849 REPORTER_ASSERT(reporter, !imageFilter->filterImage(&proxy, bitmap, ctx, &re sult, &offset)); 870 REPORTER_ASSERT(reporter, !imageFilter->filterImage(&proxy, image, ctx, resu lt, &offset));
850 } 871 }
851 872
852 DEF_TEST(ImageFilterEmptySaveLayer, reporter) { 873 DEF_TEST(ImageFilterEmptySaveLayer, reporter) {
853 // Even when there's an empty saveLayer()/restore(), ensure that an image 874 // Even when there's an empty saveLayer()/restore(), ensure that an image
854 // filter or color filter which affects transparent black still draws. 875 // filter or color filter which affects transparent black still draws.
855 876
856 SkBitmap bitmap; 877 SkBitmap bitmap;
857 bitmap.allocN32Pixels(10, 10); 878 bitmap.allocN32Pixels(10, 10);
858 SkBitmapDevice device(bitmap); 879 SkBitmapDevice device(bitmap);
859 SkCanvas canvas(&device); 880 SkCanvas canvas(&device);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 SkBitmapDevice device(temp); 1103 SkBitmapDevice device(temp);
1083 test_xfermode_cropped_input(&device, reporter); 1104 test_xfermode_cropped_input(&device, reporter);
1084 } 1105 }
1085 1106
1086 DEF_TEST(ComposedImageFilterOffset, reporter) { 1107 DEF_TEST(ComposedImageFilterOffset, reporter) {
1087 SkBitmap bitmap; 1108 SkBitmap bitmap;
1088 bitmap.allocN32Pixels(100, 100); 1109 bitmap.allocN32Pixels(100, 100);
1089 bitmap.eraseARGB(0, 0, 0, 0); 1110 bitmap.eraseARGB(0, 0, 0, 0);
1090 SkBitmapDevice device(bitmap); 1111 SkBitmapDevice device(bitmap);
1091 SkDeviceImageFilterProxy proxy(&device, SkSurfaceProps(SkSurfaceProps::kLega cyFontHost_InitType)); 1112 SkDeviceImageFilterProxy proxy(&device, SkSurfaceProps(SkSurfaceProps::kLega cyFontHost_InitType));
1092 1113 SkAutoTUnref<const SkImage> image(SkNewImageFromBitmap(bitmap, NULL));
1093 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(1, 0, 20, 20)); 1114 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(1, 0, 20, 20));
1094 SkAutoTUnref<SkImageFilter> offsetFilter(SkOffsetImageFilter::Create(0, 0, N ULL, &cropRect)); 1115 SkAutoTUnref<SkImageFilter> offsetFilter(SkOffsetImageFilter::Create(0, 0, N ULL, &cropRect));
1095 SkAutoTUnref<SkImageFilter> blurFilter(makeBlur()); 1116 SkAutoTUnref<SkImageFilter> blurFilter(makeBlur());
1096 SkAutoTUnref<SkImageFilter> composedFilter(SkComposeImageFilter::Create(blur Filter, offsetFilter.get())); 1117 SkAutoTUnref<SkImageFilter> composedFilter(SkComposeImageFilter::Create(blur Filter, offsetFilter.get()));
1097 SkBitmap result; 1118 SkAutoTUnref<const SkImage> result;
1098 SkIPoint offset; 1119 SkIPoint offset;
1099 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL); 1120 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeLargest(), NULL);
1100 REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, & result, &offset)); 1121 REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, image, ctx, re sult, &offset));
1101 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); 1122 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0);
1102 } 1123 }
1103 1124
1104 #if SK_SUPPORT_GPU 1125 #if SK_SUPPORT_GPU
1105 const SkSurfaceProps gProps = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_Ini tType); 1126 const SkSurfaceProps gProps = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_Ini tType);
1106 1127
1107 DEF_GPUTEST(ImageFilterCropRectGPU, reporter, factory) { 1128 DEF_GPUTEST(ImageFilterCropRectGPU, reporter, factory) {
1108 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 1129 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
1109 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 1130 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
1110 SkSurface::kNo_Budgeted , 1131 SkSurface::kNo_Budgeted ,
(...skipping 26 matching lines...) Expand all
1137 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { 1158 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) {
1138 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 1159 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
1139 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 1160 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
1140 SkSurface::kNo_Budgeted , 1161 SkSurface::kNo_Budgeted ,
1141 SkImageInfo::MakeN32Pre mul(1, 1), 1162 SkImageInfo::MakeN32Pre mul(1, 1),
1142 0, 1163 0,
1143 &gProps)); 1164 &gProps));
1144 test_negative_blur_sigma(device, reporter); 1165 test_negative_blur_sigma(device, reporter);
1145 } 1166 }
1146 #endif 1167 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698