Remove 'native' context unit test macro.
The only test ran long is GLPrograms. I halved its iteration count to preserve the runtime on devices that support GL and GLES.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1855993002
Review URL: https://codereview.chromium.org/1855993002
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 57274e0..52d1e03 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -331,7 +331,7 @@
GrClip clip;
SkRandom random;
- static const int NUM_TESTS = 2048;
+ static const int NUM_TESTS = 1024;
for (int t = 0; t < NUM_TESTS; t++) {
// setup random render target(can fail)
SkAutoTUnref<GrRenderTarget> rt(random_render_target(
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 58dc1a7..49455c9 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -652,7 +652,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestNegativeBlurSigma_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestNegativeBlurSigma_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_negative_blur_sigma);
}
#endif
@@ -698,7 +698,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestZeroBlurSigma_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestZeroBlurSigma_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_zero_blur_sigma);
}
#endif
@@ -732,7 +732,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterFailAffectsTransparentBlack_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterFailAffectsTransparentBlack_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_fail_affects_transparent_black);
}
#endif
@@ -946,7 +946,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterMergeResultSize_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_imagefilter_merge_result_size);
}
#endif
@@ -1081,7 +1081,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterCropRect_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCropRect_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_crop_rects);
}
#endif
@@ -1204,7 +1204,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterClippedPictureImageFilter_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterClippedPictureImageFilter_Gpu, reporter, context) {
run_gpu_test(reporter, context, 2, test_clipped_picture_imagefilter);
}
#endif
@@ -1456,7 +1456,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ComposedImageFilterOffset_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterOffset_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_composed_imagefilter_offset);
}
#endif
@@ -1500,7 +1500,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ComposedImageFilterBounds_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_composed_imagefilter_bounds);
}
#endif
@@ -1530,7 +1530,7 @@
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(PartialCropRect_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PartialCropRect_Gpu, reporter, context) {
run_gpu_test(reporter, context, 100, test_partial_crop_rect);
}
#endif
@@ -1666,7 +1666,7 @@
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(HugeBlurImageFilter_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HugeBlurImageFilter_Gpu, reporter, context) {
const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
@@ -1680,7 +1680,7 @@
test_huge_blur(&canvas, reporter);
}
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(XfermodeImageFilterCroppedInput_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, reporter, context) {
const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 8485fda..96bc48e 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -369,7 +369,7 @@
* but we don't have that facility (at the moment) so we use a little internal knowledge
* of *how* the raster version is cached, and look for that.
*/
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(SkImage_Gpu2Cpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_Gpu2Cpu, reporter, context) {
SkImageInfo info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType);
sk_sp<SkImage> image(create_gpu_image(context));
const uint32_t uniqueID = image->uniqueID();
@@ -404,7 +404,7 @@
}
}
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(SkImage_newTextureImage, reporter, context, glContext) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_newTextureImage, reporter, context, glContext) {
GrContextFactory otherFactory;
GrContextFactory::ContextInfo otherContextInfo =
otherFactory.getContextInfo(GrContextFactory::kNative_GLContextType);
@@ -701,7 +701,7 @@
REPORTER_ASSERT(reporter, image->readPixels(info, &pixel, sizeof(pixel), 0, 0));
REPORTER_ASSERT(reporter, pixel == expected);
}
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(SkImage_NewFromTexture, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_NewFromTexture, reporter, context) {
GrTextureProvider* provider = context->textureProvider();
const int w = 10;
const int h = 10;
@@ -820,7 +820,7 @@
}
}
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(DeferredTextureImage, reporter, context, glContext) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, context, glContext) {
SkAutoTUnref<GrContextThreadSafeProxy> proxy(context->threadSafeProxy());
GrContextFactory otherFactory;
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index e6552108..15aede5 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -576,7 +576,7 @@
*
* https://bug.skia.org/4351
*/
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(ReadPixels_Subset_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Subset_Gpu, reporter, context) {
SkBitmap bitmap;
make_ringed_bitmap(&bitmap, 6, 6);
const SkIRect subset = SkIRect::MakeLTRB(2, 2, 4, 4);
diff --git a/tests/Test.h b/tests/Test.h
index 7660c44..7430372 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -173,8 +173,6 @@
DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kAllRendering_GPUTestContexts, reporter, __VA_ARGS__)
#define DEF_GPUTEST_FOR_NULL_CONTEXT(name, reporter, ...) \
DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kNull_GPUTestContexts, reporter, __VA_ARGS__)
-#define DEF_GPUTEST_FOR_NATIVE_CONTEXT(name, reporter, ...) \
- DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kNative_GPUTestContexts, reporter, __VA_ARGS__)
#define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \
do { \
diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp
index d72e02d..66c9b2d 100644
--- a/tests/TestTest.cpp
+++ b/tests/TestTest.cpp
@@ -44,16 +44,6 @@
}
#endif
-// This is an example of a GPU test that tests a property that should work at least for the native
-// GPU context. If the test takes a long time to run, it may be appropriate to test only the native
-// context.
-#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestGpuNativeContext, reporter, context) {
- REPORTER_ASSERT(reporter, reporter);
- REPORTER_ASSERT(reporter, context);
-}
-#endif
-
// This is an example of a GPU test that tests a property that uses the null GPU context. It should
// be used if the test tests some behavior that is mocked with the null context.
#if SK_SUPPORT_GPU