| 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 "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 645 |
| 646 (*test)(&proxy, reporter, context); | 646 (*test)(&proxy, reporter, context); |
| 647 } | 647 } |
| 648 #endif | 648 #endif |
| 649 | 649 |
| 650 DEF_TEST(TestNegativeBlurSigma, reporter) { | 650 DEF_TEST(TestNegativeBlurSigma, reporter) { |
| 651 run_raster_test(reporter, 100, test_negative_blur_sigma); | 651 run_raster_test(reporter, 100, test_negative_blur_sigma); |
| 652 } | 652 } |
| 653 | 653 |
| 654 #if SK_SUPPORT_GPU | 654 #if SK_SUPPORT_GPU |
| 655 DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestNegativeBlurSigma_Gpu, reporter, context) { | 655 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestNegativeBlurSigma_Gpu, reporter, context)
{ |
| 656 run_gpu_test(reporter, context, 100, test_negative_blur_sigma); | 656 run_gpu_test(reporter, context, 100, test_negative_blur_sigma); |
| 657 } | 657 } |
| 658 #endif | 658 #endif |
| 659 | 659 |
| 660 static void test_zero_blur_sigma(SkImageFilter::Proxy* proxy, | 660 static void test_zero_blur_sigma(SkImageFilter::Proxy* proxy, |
| 661 skiatest::Reporter* reporter, | 661 skiatest::Reporter* reporter, |
| 662 GrContext* context) { | 662 GrContext* context) { |
| 663 // Check that SkBlurImageFilter with a zero sigma and a non-zero srcOffset w
orks correctly. | 663 // Check that SkBlurImageFilter with a zero sigma and a non-zero srcOffset w
orks correctly. |
| 664 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(5, 0, 5, 10)
)); | 664 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(5, 0, 5, 10)
)); |
| 665 sk_sp<SkImageFilter> input(SkOffsetImageFilter::Make(0, 0, nullptr, &cropRec
t)); | 665 sk_sp<SkImageFilter> input(SkOffsetImageFilter::Make(0, 0, nullptr, &cropRec
t)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 | 695 |
| 696 DEF_TEST(TestZeroBlurSigma, reporter) { | 696 DEF_TEST(TestZeroBlurSigma, reporter) { |
| 697 run_raster_test(reporter, 100, test_zero_blur_sigma); | 697 run_raster_test(reporter, 100, test_zero_blur_sigma); |
| 698 } | 698 } |
| 699 | 699 |
| 700 #if SK_SUPPORT_GPU | 700 #if SK_SUPPORT_GPU |
| 701 DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestZeroBlurSigma_Gpu, reporter, context) { | 701 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestZeroBlurSigma_Gpu, reporter, context) { |
| 702 run_gpu_test(reporter, context, 100, test_zero_blur_sigma); | 702 run_gpu_test(reporter, context, 100, test_zero_blur_sigma); |
| 703 } | 703 } |
| 704 #endif | 704 #endif |
| 705 | 705 |
| 706 | 706 |
| 707 // Tests that, even when an upstream filter has returned null (due to failure or
clipping), a | 707 // Tests that, even when an upstream filter has returned null (due to failure or
clipping), a |
| 708 // downstream filter that affects transparent black still does so even with a nu
llptr input. | 708 // downstream filter that affects transparent black still does so even with a nu
llptr input. |
| 709 static void test_fail_affects_transparent_black(SkImageFilter::Proxy* proxy, | 709 static void test_fail_affects_transparent_black(SkImageFilter::Proxy* proxy, |
| 710 skiatest::Reporter* reporter, | 710 skiatest::Reporter* reporter, |
| 711 GrContext* context) { | 711 GrContext* context) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 725 SkAutoLockPixels lock(resultBM); | 725 SkAutoLockPixels lock(resultBM); |
| 726 REPORTER_ASSERT(reporter, *resultBM.getAddr32(0, 0) == SK_ColorGREEN); | 726 REPORTER_ASSERT(reporter, *resultBM.getAddr32(0, 0) == SK_ColorGREEN); |
| 727 } | 727 } |
| 728 } | 728 } |
| 729 | 729 |
| 730 DEF_TEST(ImageFilterFailAffectsTransparentBlack, reporter) { | 730 DEF_TEST(ImageFilterFailAffectsTransparentBlack, reporter) { |
| 731 run_raster_test(reporter, 100, test_fail_affects_transparent_black); | 731 run_raster_test(reporter, 100, test_fail_affects_transparent_black); |
| 732 } | 732 } |
| 733 | 733 |
| 734 #if SK_SUPPORT_GPU | 734 #if SK_SUPPORT_GPU |
| 735 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterFailAffectsTransparentBlack_Gpu, repor
ter, context) { | 735 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterFailAffectsTransparentBlack_Gpu, r
eporter, context) { |
| 736 run_gpu_test(reporter, context, 100, test_fail_affects_transparent_black); | 736 run_gpu_test(reporter, context, 100, test_fail_affects_transparent_black); |
| 737 } | 737 } |
| 738 #endif | 738 #endif |
| 739 | 739 |
| 740 DEF_TEST(ImageFilterDrawTiled, reporter) { | 740 DEF_TEST(ImageFilterDrawTiled, reporter) { |
| 741 // Check that all filters when drawn tiled (with subsequent clip rects) exac
tly | 741 // Check that all filters when drawn tiled (with subsequent clip rects) exac
tly |
| 742 // match the same filters drawn with a single full-canvas bitmap draw. | 742 // match the same filters drawn with a single full-canvas bitmap draw. |
| 743 // Tests pass by not asserting. | 743 // Tests pass by not asserting. |
| 744 | 744 |
| 745 FilterList filters(nullptr); | 745 FilterList filters(nullptr); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 REPORTER_ASSERT(reporter, resultImg); | 939 REPORTER_ASSERT(reporter, resultImg); |
| 940 | 940 |
| 941 REPORTER_ASSERT(reporter, resultImg->width() == 20 && resultImg->height() ==
20); | 941 REPORTER_ASSERT(reporter, resultImg->width() == 20 && resultImg->height() ==
20); |
| 942 } | 942 } |
| 943 | 943 |
| 944 DEF_TEST(ImageFilterMergeResultSize, reporter) { | 944 DEF_TEST(ImageFilterMergeResultSize, reporter) { |
| 945 run_raster_test(reporter, 100, test_imagefilter_merge_result_size); | 945 run_raster_test(reporter, 100, test_imagefilter_merge_result_size); |
| 946 } | 946 } |
| 947 | 947 |
| 948 #if SK_SUPPORT_GPU | 948 #if SK_SUPPORT_GPU |
| 949 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterMergeResultSize_Gpu, reporter, context
) { | 949 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter, con
text) { |
| 950 run_gpu_test(reporter, context, 100, test_imagefilter_merge_result_size); | 950 run_gpu_test(reporter, context, 100, test_imagefilter_merge_result_size); |
| 951 } | 951 } |
| 952 #endif | 952 #endif |
| 953 | 953 |
| 954 static void draw_blurred_rect(SkCanvas* canvas) { | 954 static void draw_blurred_rect(SkCanvas* canvas) { |
| 955 SkPaint filterPaint; | 955 SkPaint filterPaint; |
| 956 filterPaint.setColor(SK_ColorWHITE); | 956 filterPaint.setColor(SK_ColorWHITE); |
| 957 filterPaint.setImageFilter(SkBlurImageFilter::Make(SkIntToScalar(8), 0, null
ptr)); | 957 filterPaint.setImageFilter(SkBlurImageFilter::Make(SkIntToScalar(8), 0, null
ptr)); |
| 958 canvas->saveLayer(nullptr, &filterPaint); | 958 canvas->saveLayer(nullptr, &filterPaint); |
| 959 SkPaint whitePaint; | 959 SkPaint whitePaint; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 canvas.saveLayer(&bounds, &filterPaint); | 1074 canvas.saveLayer(&bounds, &filterPaint); |
| 1075 canvas.drawRect(rect, rectPaint); | 1075 canvas.drawRect(rect, rectPaint); |
| 1076 canvas.restore(); | 1076 canvas.restore(); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 DEF_TEST(ImageFilterCropRect, reporter) { | 1079 DEF_TEST(ImageFilterCropRect, reporter) { |
| 1080 run_raster_test(reporter, 100, test_crop_rects); | 1080 run_raster_test(reporter, 100, test_crop_rects); |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 #if SK_SUPPORT_GPU | 1083 #if SK_SUPPORT_GPU |
| 1084 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterCropRect_Gpu, reporter, context) { | 1084 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCropRect_Gpu, reporter, context) { |
| 1085 run_gpu_test(reporter, context, 100, test_crop_rects); | 1085 run_gpu_test(reporter, context, 100, test_crop_rects); |
| 1086 } | 1086 } |
| 1087 #endif | 1087 #endif |
| 1088 | 1088 |
| 1089 DEF_TEST(ImageFilterMatrix, reporter) { | 1089 DEF_TEST(ImageFilterMatrix, reporter) { |
| 1090 SkBitmap temp; | 1090 SkBitmap temp; |
| 1091 temp.allocN32Pixels(100, 100); | 1091 temp.allocN32Pixels(100, 100); |
| 1092 SkCanvas canvas(temp); | 1092 SkCanvas canvas(temp); |
| 1093 canvas.scale(SkIntToScalar(2), SkIntToScalar(2)); | 1093 canvas.scale(SkIntToScalar(2), SkIntToScalar(2)); |
| 1094 | 1094 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 | 1197 |
| 1198 sk_sp<SkSpecialImage> resultImage(imageFilter->filterImage(srcImg.get(), ctx
, &offset)); | 1198 sk_sp<SkSpecialImage> resultImage(imageFilter->filterImage(srcImg.get(), ctx
, &offset)); |
| 1199 REPORTER_ASSERT(reporter, !resultImage); | 1199 REPORTER_ASSERT(reporter, !resultImage); |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { | 1202 DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { |
| 1203 run_raster_test(reporter, 2, test_clipped_picture_imagefilter); | 1203 run_raster_test(reporter, 2, test_clipped_picture_imagefilter); |
| 1204 } | 1204 } |
| 1205 | 1205 |
| 1206 #if SK_SUPPORT_GPU | 1206 #if SK_SUPPORT_GPU |
| 1207 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterClippedPictureImageFilter_Gpu, reporte
r, context) { | 1207 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterClippedPictureImageFilter_Gpu, rep
orter, context) { |
| 1208 run_gpu_test(reporter, context, 2, test_clipped_picture_imagefilter); | 1208 run_gpu_test(reporter, context, 2, test_clipped_picture_imagefilter); |
| 1209 } | 1209 } |
| 1210 #endif | 1210 #endif |
| 1211 | 1211 |
| 1212 DEF_TEST(ImageFilterEmptySaveLayer, reporter) { | 1212 DEF_TEST(ImageFilterEmptySaveLayer, reporter) { |
| 1213 // Even when there's an empty saveLayer()/restore(), ensure that an image | 1213 // Even when there's an empty saveLayer()/restore(), ensure that an image |
| 1214 // filter or color filter which affects transparent black still draws. | 1214 // filter or color filter which affects transparent black still draws. |
| 1215 | 1215 |
| 1216 SkBitmap bitmap; | 1216 SkBitmap bitmap; |
| 1217 bitmap.allocN32Pixels(10, 10); | 1217 bitmap.allocN32Pixels(10, 10); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1449 sk_sp<SkSpecialImage> resultImg(composedFilter->filterImage(srcImg.get(), ct
x, &offset)); | 1449 sk_sp<SkSpecialImage> resultImg(composedFilter->filterImage(srcImg.get(), ct
x, &offset)); |
| 1450 REPORTER_ASSERT(reporter, resultImg); | 1450 REPORTER_ASSERT(reporter, resultImg); |
| 1451 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); | 1451 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 DEF_TEST(ComposedImageFilterOffset, reporter) { | 1454 DEF_TEST(ComposedImageFilterOffset, reporter) { |
| 1455 run_raster_test(reporter, 100, test_composed_imagefilter_offset); | 1455 run_raster_test(reporter, 100, test_composed_imagefilter_offset); |
| 1456 } | 1456 } |
| 1457 | 1457 |
| 1458 #if SK_SUPPORT_GPU | 1458 #if SK_SUPPORT_GPU |
| 1459 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ComposedImageFilterOffset_Gpu, reporter, context)
{ | 1459 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterOffset_Gpu, reporter, cont
ext) { |
| 1460 run_gpu_test(reporter, context, 100, test_composed_imagefilter_offset); | 1460 run_gpu_test(reporter, context, 100, test_composed_imagefilter_offset); |
| 1461 } | 1461 } |
| 1462 #endif | 1462 #endif |
| 1463 | 1463 |
| 1464 static void test_composed_imagefilter_bounds(SkImageFilter::Proxy* proxy, | 1464 static void test_composed_imagefilter_bounds(SkImageFilter::Proxy* proxy, |
| 1465 skiatest::Reporter* reporter, | 1465 skiatest::Reporter* reporter, |
| 1466 GrContext* context) { | 1466 GrContext* context) { |
| 1467 // The bounds passed to the inner filter must be filtered by the outer | 1467 // The bounds passed to the inner filter must be filtered by the outer |
| 1468 // filter, so that the inner filter produces the pixels that the outer | 1468 // filter, so that the inner filter produces the pixels that the outer |
| 1469 // filter requires as input. This matters if the outer filter moves pixels. | 1469 // filter requires as input. This matters if the outer filter moves pixels. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1493 TestingSpecialImageAccess::GetROPixels(result.get(), &resultBM); | 1493 TestingSpecialImageAccess::GetROPixels(result.get(), &resultBM); |
| 1494 SkAutoLockPixels lock(resultBM); | 1494 SkAutoLockPixels lock(resultBM); |
| 1495 REPORTER_ASSERT(reporter, resultBM.getColor(50, 50) == SK_ColorGREEN); | 1495 REPORTER_ASSERT(reporter, resultBM.getColor(50, 50) == SK_ColorGREEN); |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 DEF_TEST(ComposedImageFilterBounds, reporter) { | 1498 DEF_TEST(ComposedImageFilterBounds, reporter) { |
| 1499 run_raster_test(reporter, 100, test_composed_imagefilter_bounds); | 1499 run_raster_test(reporter, 100, test_composed_imagefilter_bounds); |
| 1500 } | 1500 } |
| 1501 | 1501 |
| 1502 #if SK_SUPPORT_GPU | 1502 #if SK_SUPPORT_GPU |
| 1503 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ComposedImageFilterBounds_Gpu, reporter, context)
{ | 1503 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, cont
ext) { |
| 1504 run_gpu_test(reporter, context, 100, test_composed_imagefilter_bounds); | 1504 run_gpu_test(reporter, context, 100, test_composed_imagefilter_bounds); |
| 1505 } | 1505 } |
| 1506 #endif | 1506 #endif |
| 1507 | 1507 |
| 1508 static void test_partial_crop_rect(SkImageFilter::Proxy* proxy, | 1508 static void test_partial_crop_rect(SkImageFilter::Proxy* proxy, |
| 1509 skiatest::Reporter* reporter, | 1509 skiatest::Reporter* reporter, |
| 1510 GrContext* context) { | 1510 GrContext* context) { |
| 1511 sk_sp<SkSpecialImage> srcImg(create_empty_special_image(context, proxy, 100)
); | 1511 sk_sp<SkSpecialImage> srcImg(create_empty_special_image(context, proxy, 100)
); |
| 1512 | 1512 |
| 1513 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(100, 0, 20, 30), | 1513 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(100, 0, 20, 30), |
| 1514 SkImageFilter::CropRect::kHasWidth_CropEdge | SkImageFilter::CropRect::k
HasHeight_CropEdge); | 1514 SkImageFilter::CropRect::kHasWidth_CropEdge | SkImageFilter::CropRect::k
HasHeight_CropEdge); |
| 1515 SkAutoTUnref<SkImageFilter> filter(make_grayscale(nullptr, &cropRect)); | 1515 SkAutoTUnref<SkImageFilter> filter(make_grayscale(nullptr, &cropRect)); |
| 1516 SkIPoint offset; | 1516 SkIPoint offset; |
| 1517 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr
); | 1517 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr
); |
| 1518 | 1518 |
| 1519 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offs
et)); | 1519 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offs
et)); |
| 1520 REPORTER_ASSERT(reporter, resultImg); | 1520 REPORTER_ASSERT(reporter, resultImg); |
| 1521 | 1521 |
| 1522 REPORTER_ASSERT(reporter, offset.fX == 0); | 1522 REPORTER_ASSERT(reporter, offset.fX == 0); |
| 1523 REPORTER_ASSERT(reporter, offset.fY == 0); | 1523 REPORTER_ASSERT(reporter, offset.fY == 0); |
| 1524 REPORTER_ASSERT(reporter, resultImg->width() == 20); | 1524 REPORTER_ASSERT(reporter, resultImg->width() == 20); |
| 1525 REPORTER_ASSERT(reporter, resultImg->height() == 30); | 1525 REPORTER_ASSERT(reporter, resultImg->height() == 30); |
| 1526 } | 1526 } |
| 1527 | 1527 |
| 1528 DEF_TEST(PartialCropRect, reporter) { | 1528 DEF_TEST(PartialCropRect, reporter) { |
| 1529 run_raster_test(reporter, 100, test_partial_crop_rect); | 1529 run_raster_test(reporter, 100, test_partial_crop_rect); |
| 1530 } | 1530 } |
| 1531 | 1531 |
| 1532 #if SK_SUPPORT_GPU | 1532 #if SK_SUPPORT_GPU |
| 1533 DEF_GPUTEST_FOR_NATIVE_CONTEXT(PartialCropRect_Gpu, reporter, context) { | 1533 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PartialCropRect_Gpu, reporter, context) { |
| 1534 run_gpu_test(reporter, context, 100, test_partial_crop_rect); | 1534 run_gpu_test(reporter, context, 100, test_partial_crop_rect); |
| 1535 } | 1535 } |
| 1536 #endif | 1536 #endif |
| 1537 | 1537 |
| 1538 DEF_TEST(ImageFilterCanComputeFastBounds, reporter) { | 1538 DEF_TEST(ImageFilterCanComputeFastBounds, reporter) { |
| 1539 | 1539 |
| 1540 SkPoint3 location = SkPoint3::Make(0, 0, SK_Scalar1); | 1540 SkPoint3 location = SkPoint3::Make(0, 0, SK_Scalar1); |
| 1541 SkAutoTUnref<SkImageFilter> lighting(SkLightingImageFilter::CreatePointLitDi
ffuse( | 1541 SkAutoTUnref<SkImageFilter> lighting(SkLightingImageFilter::CreatePointLitDi
ffuse( |
| 1542 location, SK_ColorGREEN, 0, 0)); | 1542 location, SK_ColorGREEN, 0, 0)); |
| 1543 REPORTER_ASSERT(reporter, !lighting->canComputeFastBounds()); | 1543 REPORTER_ASSERT(reporter, !lighting->canComputeFastBounds()); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 canvas->drawRect(SkRect::MakeIWH(largeW, largeH), paint); | 1659 canvas->drawRect(SkRect::MakeIWH(largeW, largeH), paint); |
| 1660 } | 1660 } |
| 1661 | 1661 |
| 1662 DEF_TEST(BlurLargeImage, reporter) { | 1662 DEF_TEST(BlurLargeImage, reporter) { |
| 1663 auto surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(100, 100))); | 1663 auto surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(100, 100))); |
| 1664 test_large_blur_input(reporter, surface->getCanvas()); | 1664 test_large_blur_input(reporter, surface->getCanvas()); |
| 1665 } | 1665 } |
| 1666 | 1666 |
| 1667 #if SK_SUPPORT_GPU | 1667 #if SK_SUPPORT_GPU |
| 1668 | 1668 |
| 1669 DEF_GPUTEST_FOR_NATIVE_CONTEXT(HugeBlurImageFilter_Gpu, reporter, context) { | 1669 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HugeBlurImageFilter_Gpu, reporter, context) { |
| 1670 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1670 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
| 1671 | 1671 |
| 1672 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1672 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
| 1673 SkBudgeted::kNo, | 1673 SkBudgeted::kNo, |
| 1674 SkImageInfo::MakeN32Pre
mul(100, 100), | 1674 SkImageInfo::MakeN32Pre
mul(100, 100), |
| 1675 0, | 1675 0, |
| 1676 &props, | 1676 &props, |
| 1677 SkGpuDevice::kUninit_In
itContents)); | 1677 SkGpuDevice::kUninit_In
itContents)); |
| 1678 SkCanvas canvas(device); | 1678 SkCanvas canvas(device); |
| 1679 | 1679 |
| 1680 test_huge_blur(&canvas, reporter); | 1680 test_huge_blur(&canvas, reporter); |
| 1681 } | 1681 } |
| 1682 | 1682 |
| 1683 DEF_GPUTEST_FOR_NATIVE_CONTEXT(XfermodeImageFilterCroppedInput_Gpu, reporter, co
ntext) { | 1683 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, reporter
, context) { |
| 1684 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1684 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
| 1685 | 1685 |
| 1686 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1686 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
| 1687 SkBudgeted::kNo, | 1687 SkBudgeted::kNo, |
| 1688 SkImageInfo::MakeN32Pre
mul(1, 1), | 1688 SkImageInfo::MakeN32Pre
mul(1, 1), |
| 1689 0, | 1689 0, |
| 1690 &props, | 1690 &props, |
| 1691 SkGpuDevice::kUninit_In
itContents)); | 1691 SkGpuDevice::kUninit_In
itContents)); |
| 1692 SkCanvas canvas(device); | 1692 SkCanvas canvas(device); |
| 1693 | 1693 |
| 1694 test_xfermode_cropped_input(&canvas, reporter); | 1694 test_xfermode_cropped_input(&canvas, reporter); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { | 1697 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { |
| 1698 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, | 1698 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, |
| 1699 SkImageInfo::MakeN32Premul(100, 100
))); | 1699 SkImageInfo::MakeN32Premul(100, 100
))); |
| 1700 test_large_blur_input(reporter, surface->getCanvas()); | 1700 test_large_blur_input(reporter, surface->getCanvas()); |
| 1701 } | 1701 } |
| 1702 #endif | 1702 #endif |
| OLD | NEW |