diff options
author | 2015-12-01 04:35:26 -0800 | |
---|---|---|
committer | 2015-12-01 04:35:26 -0800 | |
commit | 1530283c483cb88aa725bce50a6d193dd00ee570 (patch) | |
tree | c34d73ac28d83690a4cbf1196854176677e07366 /tests/ImageFilterTest.cpp | |
parent | 362c900625dc2ece854678455776b711c1e44c04 (diff) |
Generate list of GPU contexts outside tests
Use DEF_GPUTEST_FOR_*_CONTEXT macros to obtain the
test GPU context.
Makes changing the context -related classes easier,
since not all tests need to be changed.
BUG=skia:2992
Review URL: https://codereview.chromium.org/1448873002
Diffstat (limited to 'tests/ImageFilterTest.cpp')
-rw-r--r-- | tests/ImageFilterTest.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 4b55274a1b..2619c6ff10 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -38,7 +38,7 @@ #include "Test.h" #if SK_SUPPORT_GPU -#include "GrContextFactory.h" +#include "GrContext.h" #include "SkGpuDevice.h" #endif @@ -1261,11 +1261,7 @@ DEF_TEST(ImageFilterImageSourceSerialization, reporter) { #if SK_SUPPORT_GPU -DEF_GPUTEST(ImageFilterCropRectGPU, reporter, factory) { - GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(0)); - if (nullptr == context) { - return; - } +DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterCropRect_Gpu, reporter, context) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, @@ -1279,11 +1275,7 @@ DEF_GPUTEST(ImageFilterCropRectGPU, reporter, factory) { test_crop_rects(&proxy, reporter); } -DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { - GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(0)); - if (nullptr == context) { - return; - } +DEF_GPUTEST_FOR_NATIVE_CONTEXT(HugeBlurImageFilter_Gpu, reporter, context) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, @@ -1297,11 +1289,7 @@ DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { test_huge_blur(&canvas, reporter); } -DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { - GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(0)); - if (nullptr == context) { - return; - } +DEF_GPUTEST_FOR_NATIVE_CONTEXT(XfermodeImageFilterCroppedInput_Gpu, reporter, context) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, @@ -1315,11 +1303,7 @@ DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { test_xfermode_cropped_input(&canvas, reporter); } -DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { - GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(0)); - if (nullptr == context) { - return; - } +DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestNegativeBlurSigma_Gpu, reporter, context) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |