diff options
author | egdaniel <egdaniel@google.com> | 2016-06-28 08:07:26 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-28 08:07:26 -0700 |
commit | ab527a5bbfb1eae4f99a1435d349a44d00477d82 (patch) | |
tree | 60f263e5f6162814a510b54419ee7ac939bc23e6 | |
parent | 085cad4abcca4e10dcc6ba95347c378d4c47fb90 (diff) |
Enable many more tests for Vulkan
BUG=skia:5461
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103133002
Review-Url: https://codereview.chromium.org/2103133002
-rw-r--r-- | include/gpu/vk/GrVkTypes.h | 2 | ||||
-rw-r--r-- | src/gpu/vk/GrVkImage.cpp | 3 | ||||
-rw-r--r-- | tests/BlurTest.cpp | 2 | ||||
-rw-r--r-- | tests/ImageFilterCacheTest.cpp | 2 | ||||
-rw-r--r-- | tests/ImageFilterTest.cpp | 12 | ||||
-rw-r--r-- | tests/ImageIsOpaqueTest.cpp | 2 | ||||
-rw-r--r-- | tests/ImageTest.cpp | 6 | ||||
-rw-r--r-- | tests/ProxyTest.cpp | 4 | ||||
-rw-r--r-- | tests/ReadWriteAlphaTest.cpp | 2 | ||||
-rw-r--r-- | tests/SRGBReadWritePixelsTest.cpp | 2 | ||||
-rw-r--r-- | tests/SpecialSurfaceTest.cpp | 2 | ||||
-rw-r--r-- | tests/SurfaceTest.cpp | 24 | ||||
-rw-r--r-- | tests/TestTest.cpp | 2 |
13 files changed, 34 insertions, 31 deletions
diff --git a/include/gpu/vk/GrVkTypes.h b/include/gpu/vk/GrVkTypes.h index 4647343226..782cb90b21 100644 --- a/include/gpu/vk/GrVkTypes.h +++ b/include/gpu/vk/GrVkTypes.h @@ -27,7 +27,7 @@ /////////////////////////////////////////////////////////////////////////////// /** - * Types for interacting with Vulkan resources created externally to Skia. GrBackendObjects for + * Types for interacting with Vulkan resources created externally to Skia. GrBackendObjects for * Vulkan textures are really const GrVkImageInfo* */ struct GrVkAlloc { diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp index 70dd4486ae..11e27ed664 100644 --- a/src/gpu/vk/GrVkImage.cpp +++ b/src/gpu/vk/GrVkImage.cpp @@ -61,6 +61,9 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout, } bool GrVkImage::InitImageInfo(const GrVkGpu* gpu, const ImageDesc& imageDesc, GrVkImageInfo* info) { + if (0 == imageDesc.fWidth || 0 == imageDesc.fHeight) { + return false; + } VkImage image = 0; GrVkAlloc alloc; diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp index 731657acde..c40634c12a 100644 --- a/tests/BlurTest.cpp +++ b/tests/BlurTest.cpp @@ -556,7 +556,7 @@ DEF_TEST(BlurAsABlur, reporter) { // This exercises the problem discovered in crbug.com/570232. The return value from // SkBlurMask::BoxBlur wasn't being checked in SkBlurMaskFilter.cpp::GrRRectBlurEffect::Create -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctxInfo) { SkImageInfo info = SkImageInfo::MakeN32Premul(128, 128); auto surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info)); diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp index 9f46a35fd7..640debbf8b 100644 --- a/tests/ImageFilterCacheTest.cpp +++ b/tests/ImageFilterCacheTest.cpp @@ -190,7 +190,7 @@ static GrTexture* create_texture(GrContext* context) { return context->textureProvider()->createTexture(desc, SkBudgeted::kNo, srcBM.getPixels(), 0); } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterCache_ImageBackedGPU, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_ImageBackedGPU, reporter, ctxInfo) { SkAutoTUnref<GrTexture> srcTexture(create_texture(ctxInfo.grContext())); if (!srcTexture) { return; diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 12b1caa16d..dd0824551b 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -915,7 +915,7 @@ DEF_TEST(ImageFilterMergeResultSize, reporter) { } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter, ctxInfo) { test_imagefilter_merge_result_size(reporter, ctxInfo.grContext()); } #endif @@ -1083,8 +1083,8 @@ DEF_TEST(ImageFilterMatrixConvolutionBigKernel, reporter) { } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterMatrixConvolutionBigKernel_Gpu, - reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMatrixConvolutionBigKernel_Gpu, + reporter, ctxInfo) { test_big_kernel(reporter, ctxInfo.grContext()); } #endif @@ -1514,7 +1514,7 @@ DEF_TEST(ComposedImageFilterBounds, reporter) { } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, ctxInfo) { test_composed_imagefilter_bounds(reporter, ctxInfo.grContext()); } #endif @@ -1753,7 +1753,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterHugeBlur_Gpu, reporter, ctxInfo) { test_huge_blur(canvas, reporter); } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, reporter, ctxInfo) { sk_sp<SkSurface> surf(SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, @@ -1765,7 +1765,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(XfermodeImageFilterCroppedInput_Gpu, repor test_xfermode_cropped_input(canvas, reporter); } -DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_ALL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo) { auto surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kYes, SkImageInfo::MakeN32Premul(100, 100))); test_large_blur_input(reporter, surface->getCanvas()); diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp index 843c1d1aa0..0660885a54 100644 --- a/tests/ImageIsOpaqueTest.cpp +++ b/tests/ImageIsOpaqueTest.cpp @@ -72,7 +72,7 @@ DEF_TEST(ImageIsOpaqueTest, reporter) { #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageIsOpaqueTest_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageIsOpaqueTest_Gpu, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5); auto surfaceTransparent(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, infoTransparent)); diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index e681b1a702..4d43e46eb1 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -597,7 +597,7 @@ DEF_TEST(ImageReadPixels, reporter) { test_read_pixels(reporter, image.get()); } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageReadPixels_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageReadPixels_Gpu, reporter, ctxInfo) { test_read_pixels(reporter, create_gpu_image(ctxInfo.grContext()).get()); } #endif @@ -704,7 +704,7 @@ DEF_TEST(ImagePeek, reporter) { test_peek(reporter, image.get(), false); } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImagePeek_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImagePeek_Gpu, reporter, ctxInfo) { sk_sp<SkImage> image(create_gpu_image(ctxInfo.grContext())); test_peek(reporter, image.get(), false); } @@ -819,7 +819,7 @@ static void check_images_same(skiatest::Reporter* reporter, const SkImage* a, co } } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(NewTextureFromPixmap, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(NewTextureFromPixmap, reporter, ctxInfo) { for (auto create : {&create_image, &create_image_565, &create_image_ct}) { diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp index 5f27b89f5a..2ed4591a72 100644 --- a/tests/ProxyTest.cpp +++ b/tests/ProxyTest.cpp @@ -75,7 +75,7 @@ static void check_texture(skiatest::Reporter* reporter, } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }) { @@ -122,7 +122,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) { } } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) { GrTextureProvider* provider = ctxInfo.grContext()->textureProvider(); static const int kWidthHeight = 100; diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index cc83b860de..630924aca6 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -34,7 +34,7 @@ static void validate_alpha_data(skiatest::Reporter* reporter, int w, int h, cons } } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { unsigned char alphaData[X_SIZE * Y_SIZE]; static const int kClearValue = 0x2; diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp index fdaa587de7..840575a1c4 100644 --- a/tests/SRGBReadWritePixelsTest.cpp +++ b/tests/SRGBReadWritePixelsTest.cpp @@ -138,7 +138,7 @@ void read_and_check_pixels(skiatest::Reporter* reporter, GrTexture* texture, uin // TODO: Add tests for copySurface between srgb/linear textures. Add tests for unpremul/premul // conversion during read/write along with srgb/linear conversions. -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); #if defined(GOOGLE3) // Stack frame size is limited in GOOGLE3. diff --git a/tests/SpecialSurfaceTest.cpp b/tests/SpecialSurfaceTest.cpp index 4b81691040..2bb1005e2a 100644 --- a/tests/SpecialSurfaceTest.cpp +++ b/tests/SpecialSurfaceTest.cpp @@ -78,7 +78,7 @@ DEF_TEST(SpecialSurface_Raster2, reporter) { #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, ctxInfo) { sk_sp<SkSpecialSurface> surf(SkSpecialSurface::MakeRenderTarget(ctxInfo.grContext(), kSmallerSize, kSmallerSize, kSkia8888_GrPixelConfig)); diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index bf6445f00c..a92ecbe50b 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -76,7 +76,7 @@ DEF_TEST(SurfaceEmpty, reporter) { } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, ctxInfo) { const SkImageInfo info = SkImageInfo::Make(0, 0, kN32_SkColorType, kPremul_SkAlphaType); REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info, 0, @@ -119,7 +119,7 @@ DEF_TEST(SurfaceCanvasPeek, reporter) { } } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { SkImageInfo requestInfo; auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, &requestInfo)); @@ -152,7 +152,7 @@ DEF_TEST(SurfaceAccessPixels, reporter) { } } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAccessPixels_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceAccessPixels_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); test_access_pixels(reporter, surface); @@ -181,7 +181,7 @@ DEF_TEST(SurfaceSnapshotAlphaType, reporter) { } } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceSnapshotAlphaType_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceSnapshotAlphaType_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { for (auto& isOpaque : { true, false }) { SkAlphaType alphaType = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType; @@ -526,7 +526,7 @@ DEF_TEST(SurfaceCopyOnWrite, reporter) { test_copy_on_write(reporter, create_surface().get()); } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceCopyOnWrite_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCopyOnWrite_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); test_copy_on_write(reporter, surface.get()); @@ -548,7 +548,7 @@ DEF_TEST(SurfaceWriteableAfterSnapshotRelease, reporter) { test_writable_after_snapshot_release(reporter, create_surface().get()); } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceWriteableAfterSnapshotRelease_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceWriteableAfterSnapshotRelease_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); test_writable_after_snapshot_release(reporter, surface.get()); @@ -589,7 +589,7 @@ static void test_crbug263329(skiatest::Reporter* reporter, REPORTER_ASSERT(reporter, as_IB(image3)->peekTexture() != as_IB(image1)->peekTexture()); REPORTER_ASSERT(reporter, as_IB(image2)->peekTexture() != as_IB(image1)->peekTexture()); } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { auto surface1(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); auto surface2(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); @@ -606,7 +606,7 @@ DEF_TEST(SurfaceGetTexture, reporter) { REPORTER_ASSERT(reporter, as_IB(image)->peekTexture() == nullptr); } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) { for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr)); sk_sp<SkImage> image(surface->makeImageSnapshot()); @@ -638,7 +638,7 @@ static SkBudgeted is_budgeted(const sk_sp<SkImage> image) { return is_budgeted(image.get()); } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceBudget, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, ctxInfo) { SkImageInfo info = SkImageInfo::MakeN32Premul(8,8); for (auto sbudgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) { for (auto ibudgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) { @@ -700,7 +700,7 @@ DEF_TEST(SurfaceNoCanvas, reporter) { } } #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceNoCanvas_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceNoCanvas_Gpu, reporter, ctxInfo) { SkSurface::ContentChangeMode modes[] = { SkSurface::kDiscard_ContentChangeMode, SkSurface::kRetain_ContentChangeMode}; for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) { @@ -841,7 +841,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); std::function<GrSurface*(SkSurface*)> grSurfaceGetters[] = { - [] (SkSurface* s){ + [] (SkSurface* s){ GrDrawContext* dc = s->getCanvas()->internal_private_accessTopLayerDrawContext(); return dc->accessRenderTarget(); }, [] (SkSurface* s){ @@ -913,7 +913,7 @@ static void test_surface_draw_partially( } } -DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) { +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) { GrGpu* gpu = ctxInfo.grContext()->getGpu(); if (!gpu) { return; diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp index 27ec1634df..d366bb4703 100644 --- a/tests/TestTest.cpp +++ b/tests/TestTest.cpp @@ -29,7 +29,7 @@ DEF_GPUTEST(TestGpuFactory, reporter, factory) { // This is an example of a GPU test that tests a property that should work for all GPU contexts. // Note: Some of the contexts might not produce a rendering output. #if SK_SUPPORT_GPU -DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) { +DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) { REPORTER_ASSERT(reporter, reporter); REPORTER_ASSERT(reporter, ctxInfo.grContext()); } |