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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 649 |
650 (*test)(&proxy, reporter, context); | 650 (*test)(&proxy, reporter, context); |
651 } | 651 } |
652 #endif | 652 #endif |
653 | 653 |
654 DEF_TEST(TestNegativeBlurSigma, reporter) { | 654 DEF_TEST(TestNegativeBlurSigma, reporter) { |
655 run_raster_test(reporter, 100, test_negative_blur_sigma); | 655 run_raster_test(reporter, 100, test_negative_blur_sigma); |
656 } | 656 } |
657 | 657 |
658 #if SK_SUPPORT_GPU | 658 #if SK_SUPPORT_GPU |
659 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestNegativeBlurSigma_Gpu, reporter, ctxInfo)
{ | 659 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(TestNegativeBlurSigma_Gpu, reporter, ctxIn
fo) { |
660 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_negative_blur_sigma); | 660 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_negative_blur_sigma); |
661 } | 661 } |
662 #endif | 662 #endif |
663 | 663 |
664 static void test_zero_blur_sigma(SkImageFilter::Proxy* proxy, | 664 static void test_zero_blur_sigma(SkImageFilter::Proxy* proxy, |
665 skiatest::Reporter* reporter, | 665 skiatest::Reporter* reporter, |
666 GrContext* context) { | 666 GrContext* context) { |
667 // Check that SkBlurImageFilter with a zero sigma and a non-zero srcOffset w
orks correctly. | 667 // Check that SkBlurImageFilter with a zero sigma and a non-zero srcOffset w
orks correctly. |
668 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(5, 0, 5, 10)
)); | 668 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(5, 0, 5, 10)
)); |
669 sk_sp<SkImageFilter> input(SkOffsetImageFilter::Make(0, 0, nullptr, &cropRec
t)); | 669 sk_sp<SkImageFilter> input(SkOffsetImageFilter::Make(0, 0, nullptr, &cropRec
t)); |
(...skipping 25 matching lines...) Expand all Loading... |
695 } | 695 } |
696 } | 696 } |
697 } | 697 } |
698 } | 698 } |
699 | 699 |
700 DEF_TEST(TestZeroBlurSigma, reporter) { | 700 DEF_TEST(TestZeroBlurSigma, reporter) { |
701 run_raster_test(reporter, 100, test_zero_blur_sigma); | 701 run_raster_test(reporter, 100, test_zero_blur_sigma); |
702 } | 702 } |
703 | 703 |
704 #if SK_SUPPORT_GPU | 704 #if SK_SUPPORT_GPU |
705 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestZeroBlurSigma_Gpu, reporter, ctxInfo) { | 705 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(TestZeroBlurSigma_Gpu, reporter, ctxInfo)
{ |
706 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_zero_blur_sigma); | 706 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_zero_blur_sigma); |
707 } | 707 } |
708 #endif | 708 #endif |
709 | 709 |
710 | 710 |
711 // Tests that, even when an upstream filter has returned null (due to failure or
clipping), a | 711 // Tests that, even when an upstream filter has returned null (due to failure or
clipping), a |
712 // downstream filter that affects transparent black still does so even with a nu
llptr input. | 712 // downstream filter that affects transparent black still does so even with a nu
llptr input. |
713 static void test_fail_affects_transparent_black(SkImageFilter::Proxy* proxy, | 713 static void test_fail_affects_transparent_black(SkImageFilter::Proxy* proxy, |
714 skiatest::Reporter* reporter, | 714 skiatest::Reporter* reporter, |
715 GrContext* context) { | 715 GrContext* context) { |
(...skipping 13 matching lines...) Expand all Loading... |
729 SkAutoLockPixels lock(resultBM); | 729 SkAutoLockPixels lock(resultBM); |
730 REPORTER_ASSERT(reporter, *resultBM.getAddr32(0, 0) == SK_ColorGREEN); | 730 REPORTER_ASSERT(reporter, *resultBM.getAddr32(0, 0) == SK_ColorGREEN); |
731 } | 731 } |
732 } | 732 } |
733 | 733 |
734 DEF_TEST(ImageFilterFailAffectsTransparentBlack, reporter) { | 734 DEF_TEST(ImageFilterFailAffectsTransparentBlack, reporter) { |
735 run_raster_test(reporter, 100, test_fail_affects_transparent_black); | 735 run_raster_test(reporter, 100, test_fail_affects_transparent_black); |
736 } | 736 } |
737 | 737 |
738 #if SK_SUPPORT_GPU | 738 #if SK_SUPPORT_GPU |
739 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterFailAffectsTransparentBlack_Gpu, r
eporter, ctxInfo) { | 739 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterFailAffectsTransparentBlack_Gpu
, reporter, ctxInfo) { |
740 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_fail_affects_transparen
t_black); | 740 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_fail_affects_transparen
t_black); |
741 } | 741 } |
742 #endif | 742 #endif |
743 | 743 |
744 DEF_TEST(ImageFilterDrawTiled, reporter) { | 744 DEF_TEST(ImageFilterDrawTiled, reporter) { |
745 // Check that all filters when drawn tiled (with subsequent clip rects) exac
tly | 745 // Check that all filters when drawn tiled (with subsequent clip rects) exac
tly |
746 // match the same filters drawn with a single full-canvas bitmap draw. | 746 // match the same filters drawn with a single full-canvas bitmap draw. |
747 // Tests pass by not asserting. | 747 // Tests pass by not asserting. |
748 | 748 |
749 FilterList filters(nullptr); | 749 FilterList filters(nullptr); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 REPORTER_ASSERT(reporter, resultImg); | 945 REPORTER_ASSERT(reporter, resultImg); |
946 | 946 |
947 REPORTER_ASSERT(reporter, resultImg->width() == 20 && resultImg->height() ==
20); | 947 REPORTER_ASSERT(reporter, resultImg->width() == 20 && resultImg->height() ==
20); |
948 } | 948 } |
949 | 949 |
950 DEF_TEST(ImageFilterMergeResultSize, reporter) { | 950 DEF_TEST(ImageFilterMergeResultSize, reporter) { |
951 run_raster_test(reporter, 100, test_imagefilter_merge_result_size); | 951 run_raster_test(reporter, 100, test_imagefilter_merge_result_size); |
952 } | 952 } |
953 | 953 |
954 #if SK_SUPPORT_GPU | 954 #if SK_SUPPORT_GPU |
955 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter, ctx
Info) { | 955 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter,
ctxInfo) { |
956 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_imagefilter_merge_resul
t_size); | 956 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_imagefilter_merge_resul
t_size); |
957 } | 957 } |
958 #endif | 958 #endif |
959 | 959 |
960 static void draw_blurred_rect(SkCanvas* canvas) { | 960 static void draw_blurred_rect(SkCanvas* canvas) { |
961 SkPaint filterPaint; | 961 SkPaint filterPaint; |
962 filterPaint.setColor(SK_ColorWHITE); | 962 filterPaint.setColor(SK_ColorWHITE); |
963 filterPaint.setImageFilter(SkBlurImageFilter::Make(SkIntToScalar(8), 0, null
ptr)); | 963 filterPaint.setImageFilter(SkBlurImageFilter::Make(SkIntToScalar(8), 0, null
ptr)); |
964 canvas->saveLayer(nullptr, &filterPaint); | 964 canvas->saveLayer(nullptr, &filterPaint); |
965 SkPaint whitePaint; | 965 SkPaint whitePaint; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 canvas.saveLayer(&bounds, &filterPaint); | 1080 canvas.saveLayer(&bounds, &filterPaint); |
1081 canvas.drawRect(rect, rectPaint); | 1081 canvas.drawRect(rect, rectPaint); |
1082 canvas.restore(); | 1082 canvas.restore(); |
1083 } | 1083 } |
1084 | 1084 |
1085 DEF_TEST(ImageFilterCropRect, reporter) { | 1085 DEF_TEST(ImageFilterCropRect, reporter) { |
1086 run_raster_test(reporter, 100, test_crop_rects); | 1086 run_raster_test(reporter, 100, test_crop_rects); |
1087 } | 1087 } |
1088 | 1088 |
1089 #if SK_SUPPORT_GPU | 1089 #if SK_SUPPORT_GPU |
1090 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCropRect_Gpu, reporter, ctxInfo) { | 1090 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterCropRect_Gpu, reporter, ctxInfo
) { |
1091 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_crop_rects); | 1091 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_crop_rects); |
1092 } | 1092 } |
1093 #endif | 1093 #endif |
1094 | 1094 |
1095 DEF_TEST(ImageFilterMatrix, reporter) { | 1095 DEF_TEST(ImageFilterMatrix, reporter) { |
1096 SkBitmap temp; | 1096 SkBitmap temp; |
1097 temp.allocN32Pixels(100, 100); | 1097 temp.allocN32Pixels(100, 100); |
1098 SkCanvas canvas(temp); | 1098 SkCanvas canvas(temp); |
1099 canvas.scale(SkIntToScalar(2), SkIntToScalar(2)); | 1099 canvas.scale(SkIntToScalar(2), SkIntToScalar(2)); |
1100 | 1100 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 | 1203 |
1204 sk_sp<SkSpecialImage> resultImage(imageFilter->filterImage(srcImg.get(), ctx
, &offset)); | 1204 sk_sp<SkSpecialImage> resultImage(imageFilter->filterImage(srcImg.get(), ctx
, &offset)); |
1205 REPORTER_ASSERT(reporter, !resultImage); | 1205 REPORTER_ASSERT(reporter, !resultImage); |
1206 } | 1206 } |
1207 | 1207 |
1208 DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { | 1208 DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { |
1209 run_raster_test(reporter, 2, test_clipped_picture_imagefilter); | 1209 run_raster_test(reporter, 2, test_clipped_picture_imagefilter); |
1210 } | 1210 } |
1211 | 1211 |
1212 #if SK_SUPPORT_GPU | 1212 #if SK_SUPPORT_GPU |
1213 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterClippedPictureImageFilter_Gpu, rep
orter, ctxInfo) { | 1213 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterClippedPictureImageFilter_Gpu,
reporter, ctxInfo) { |
1214 run_gpu_test(reporter, ctxInfo.fGrContext, 2, test_clipped_picture_imagefilt
er); | 1214 run_gpu_test(reporter, ctxInfo.fGrContext, 2, test_clipped_picture_imagefilt
er); |
1215 } | 1215 } |
1216 #endif | 1216 #endif |
1217 | 1217 |
1218 DEF_TEST(ImageFilterEmptySaveLayer, reporter) { | 1218 DEF_TEST(ImageFilterEmptySaveLayer, reporter) { |
1219 // Even when there's an empty saveLayer()/restore(), ensure that an image | 1219 // Even when there's an empty saveLayer()/restore(), ensure that an image |
1220 // filter or color filter which affects transparent black still draws. | 1220 // filter or color filter which affects transparent black still draws. |
1221 | 1221 |
1222 SkBitmap bitmap; | 1222 SkBitmap bitmap; |
1223 bitmap.allocN32Pixels(10, 10); | 1223 bitmap.allocN32Pixels(10, 10); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 sk_sp<SkSpecialImage> resultImg(composedFilter->filterImage(srcImg.get(), ct
x, &offset)); | 1458 sk_sp<SkSpecialImage> resultImg(composedFilter->filterImage(srcImg.get(), ct
x, &offset)); |
1459 REPORTER_ASSERT(reporter, resultImg); | 1459 REPORTER_ASSERT(reporter, resultImg); |
1460 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); | 1460 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); |
1461 } | 1461 } |
1462 | 1462 |
1463 DEF_TEST(ComposedImageFilterOffset, reporter) { | 1463 DEF_TEST(ComposedImageFilterOffset, reporter) { |
1464 run_raster_test(reporter, 100, test_composed_imagefilter_offset); | 1464 run_raster_test(reporter, 100, test_composed_imagefilter_offset); |
1465 } | 1465 } |
1466 | 1466 |
1467 #if SK_SUPPORT_GPU | 1467 #if SK_SUPPORT_GPU |
1468 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterOffset_Gpu, reporter, ctxI
nfo) { | 1468 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ComposedImageFilterOffset_Gpu, reporter, c
txInfo) { |
1469 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_composed_imagefilter_of
fset); | 1469 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_composed_imagefilter_of
fset); |
1470 } | 1470 } |
1471 #endif | 1471 #endif |
1472 | 1472 |
1473 static void test_composed_imagefilter_bounds(SkImageFilter::Proxy* proxy, | 1473 static void test_composed_imagefilter_bounds(SkImageFilter::Proxy* proxy, |
1474 skiatest::Reporter* reporter, | 1474 skiatest::Reporter* reporter, |
1475 GrContext* context) { | 1475 GrContext* context) { |
1476 // The bounds passed to the inner filter must be filtered by the outer | 1476 // The bounds passed to the inner filter must be filtered by the outer |
1477 // filter, so that the inner filter produces the pixels that the outer | 1477 // filter, so that the inner filter produces the pixels that the outer |
1478 // filter requires as input. This matters if the outer filter moves pixels. | 1478 // filter requires as input. This matters if the outer filter moves pixels. |
(...skipping 23 matching lines...) Expand all Loading... |
1502 TestingSpecialImageAccess::GetROPixels(result.get(), &resultBM); | 1502 TestingSpecialImageAccess::GetROPixels(result.get(), &resultBM); |
1503 SkAutoLockPixels lock(resultBM); | 1503 SkAutoLockPixels lock(resultBM); |
1504 REPORTER_ASSERT(reporter, resultBM.getColor(50, 50) == SK_ColorGREEN); | 1504 REPORTER_ASSERT(reporter, resultBM.getColor(50, 50) == SK_ColorGREEN); |
1505 } | 1505 } |
1506 | 1506 |
1507 DEF_TEST(ComposedImageFilterBounds, reporter) { | 1507 DEF_TEST(ComposedImageFilterBounds, reporter) { |
1508 run_raster_test(reporter, 100, test_composed_imagefilter_bounds); | 1508 run_raster_test(reporter, 100, test_composed_imagefilter_bounds); |
1509 } | 1509 } |
1510 | 1510 |
1511 #if SK_SUPPORT_GPU | 1511 #if SK_SUPPORT_GPU |
1512 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, ctxI
nfo) { | 1512 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, c
txInfo) { |
1513 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_composed_imagefilter_bo
unds); | 1513 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_composed_imagefilter_bo
unds); |
1514 } | 1514 } |
1515 #endif | 1515 #endif |
1516 | 1516 |
1517 static void test_partial_crop_rect(SkImageFilter::Proxy* proxy, | 1517 static void test_partial_crop_rect(SkImageFilter::Proxy* proxy, |
1518 skiatest::Reporter* reporter, | 1518 skiatest::Reporter* reporter, |
1519 GrContext* context) { | 1519 GrContext* context) { |
1520 sk_sp<SkSpecialImage> srcImg(create_empty_special_image(context, proxy, 100)
); | 1520 sk_sp<SkSpecialImage> srcImg(create_empty_special_image(context, proxy, 100)
); |
1521 | 1521 |
1522 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(100, 0, 20, 30), | 1522 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(100, 0, 20, 30), |
1523 SkImageFilter::CropRect::kHasWidth_CropEdge | SkImageFilter::CropRect::k
HasHeight_CropEdge); | 1523 SkImageFilter::CropRect::kHasWidth_CropEdge | SkImageFilter::CropRect::k
HasHeight_CropEdge); |
1524 sk_sp<SkImageFilter> filter(make_grayscale(nullptr, &cropRect)); | 1524 sk_sp<SkImageFilter> filter(make_grayscale(nullptr, &cropRect)); |
1525 SkIPoint offset; | 1525 SkIPoint offset; |
1526 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr
); | 1526 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr
); |
1527 | 1527 |
1528 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offs
et)); | 1528 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offs
et)); |
1529 REPORTER_ASSERT(reporter, resultImg); | 1529 REPORTER_ASSERT(reporter, resultImg); |
1530 | 1530 |
1531 REPORTER_ASSERT(reporter, offset.fX == 0); | 1531 REPORTER_ASSERT(reporter, offset.fX == 0); |
1532 REPORTER_ASSERT(reporter, offset.fY == 0); | 1532 REPORTER_ASSERT(reporter, offset.fY == 0); |
1533 REPORTER_ASSERT(reporter, resultImg->width() == 20); | 1533 REPORTER_ASSERT(reporter, resultImg->width() == 20); |
1534 REPORTER_ASSERT(reporter, resultImg->height() == 30); | 1534 REPORTER_ASSERT(reporter, resultImg->height() == 30); |
1535 } | 1535 } |
1536 | 1536 |
1537 DEF_TEST(PartialCropRect, reporter) { | 1537 DEF_TEST(PartialCropRect, reporter) { |
1538 run_raster_test(reporter, 100, test_partial_crop_rect); | 1538 run_raster_test(reporter, 100, test_partial_crop_rect); |
1539 } | 1539 } |
1540 | 1540 |
1541 #if SK_SUPPORT_GPU | 1541 #if SK_SUPPORT_GPU |
1542 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PartialCropRect_Gpu, reporter, ctxInfo) { | 1542 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(PartialCropRect_Gpu, reporter, ctxInfo) { |
1543 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_partial_crop_rect); | 1543 run_gpu_test(reporter, ctxInfo.fGrContext, 100, test_partial_crop_rect); |
1544 } | 1544 } |
1545 #endif | 1545 #endif |
1546 | 1546 |
1547 DEF_TEST(ImageFilterCanComputeFastBounds, reporter) { | 1547 DEF_TEST(ImageFilterCanComputeFastBounds, reporter) { |
1548 | 1548 |
1549 SkPoint3 location = SkPoint3::Make(0, 0, SK_Scalar1); | 1549 SkPoint3 location = SkPoint3::Make(0, 0, SK_Scalar1); |
1550 SkAutoTUnref<SkImageFilter> lighting(SkLightingImageFilter::CreatePointLitDi
ffuse( | 1550 SkAutoTUnref<SkImageFilter> lighting(SkLightingImageFilter::CreatePointLitDi
ffuse( |
1551 location, SK_ColorGREEN, 0, 0)); | 1551 location, SK_ColorGREEN, 0, 0)); |
1552 REPORTER_ASSERT(reporter, !lighting->canComputeFastBounds()); | 1552 REPORTER_ASSERT(reporter, !lighting->canComputeFastBounds()); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 canvas->drawRect(SkRect::MakeIWH(largeW, largeH), paint); | 1670 canvas->drawRect(SkRect::MakeIWH(largeW, largeH), paint); |
1671 } | 1671 } |
1672 | 1672 |
1673 DEF_TEST(BlurLargeImage, reporter) { | 1673 DEF_TEST(BlurLargeImage, reporter) { |
1674 auto surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(100, 100))); | 1674 auto surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(100, 100))); |
1675 test_large_blur_input(reporter, surface->getCanvas()); | 1675 test_large_blur_input(reporter, surface->getCanvas()); |
1676 } | 1676 } |
1677 | 1677 |
1678 #if SK_SUPPORT_GPU | 1678 #if SK_SUPPORT_GPU |
1679 | 1679 |
1680 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HugeBlurImageFilter_Gpu, reporter, ctxInfo) { | 1680 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(HugeBlurImageFilter_Gpu, reporter, ctxInfo
) { |
1681 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1681 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
1682 | 1682 |
1683 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctxInfo.fGrContext, | 1683 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctxInfo.fGrContext, |
1684 SkBudgeted::kNo, | 1684 SkBudgeted::kNo, |
1685 SkImageInfo::MakeN32Pre
mul(100, 100), | 1685 SkImageInfo::MakeN32Pre
mul(100, 100), |
1686 0, | 1686 0, |
1687 &props, | 1687 &props, |
1688 SkGpuDevice::kUninit_In
itContents)); | 1688 SkGpuDevice::kUninit_In
itContents)); |
1689 SkCanvas canvas(device); | 1689 SkCanvas canvas(device); |
1690 | 1690 |
1691 test_huge_blur(&canvas, reporter); | 1691 test_huge_blur(&canvas, reporter); |
1692 } | 1692 } |
1693 | 1693 |
1694 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, reporter
, ctxInfo) { | 1694 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, repor
ter, ctxInfo) { |
1695 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1695 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
1696 | 1696 |
1697 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctxInfo.fGrContext, | 1697 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctxInfo.fGrContext, |
1698 SkBudgeted::kNo, | 1698 SkBudgeted::kNo, |
1699 SkImageInfo::MakeN32Pre
mul(1, 1), | 1699 SkImageInfo::MakeN32Pre
mul(1, 1), |
1700 0, | 1700 0, |
1701 &props, | 1701 &props, |
1702 SkGpuDevice::kUninit_In
itContents)); | 1702 SkGpuDevice::kUninit_In
itContents)); |
1703 SkCanvas canvas(device); | 1703 SkCanvas canvas(device); |
1704 | 1704 |
1705 test_xfermode_cropped_input(&canvas, reporter); | 1705 test_xfermode_cropped_input(&canvas, reporter); |
1706 } | 1706 } |
1707 | 1707 |
1708 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, ctxInfo) { | 1708 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(BlurLargeImage_Gpu, reporter, ctxInfo) { |
1709 auto surface(SkSurface::MakeRenderTarget(ctxInfo.fGrContext, SkBudgeted::kYe
s, | 1709 auto surface(SkSurface::MakeRenderTarget(ctxInfo.fGrContext, SkBudgeted::kYe
s, |
1710 SkImageInfo::MakeN32Premul(100, 100
))); | 1710 SkImageInfo::MakeN32Premul(100, 100
))); |
1711 test_large_blur_input(reporter, surface->getCanvas()); | 1711 test_large_blur_input(reporter, surface->getCanvas()); |
1712 } | 1712 } |
1713 #endif | 1713 #endif |
OLD | NEW |