Index: ui/gl/gl_image_io_surface_unittest.cc |
diff --git a/ui/gl/gl_image_io_surface_unittest.cc b/ui/gl/gl_image_io_surface_unittest.cc |
index c9ca715bfdfe1551c3801118d23f00e0602d9f6e..3f6b690aa834bf97938e96546f9b726905535cbb 100644 |
--- a/ui/gl/gl_image_io_surface_unittest.cc |
+++ b/ui/gl/gl_image_io_surface_unittest.cc |
@@ -11,10 +11,10 @@ |
namespace gl { |
namespace { |
-template <gfx::BufferFormat format> |
class GLImageIOSurfaceTestDelegate { |
public: |
scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, |
+ gfx::BufferFormat format, |
const uint8_t color[4]) const { |
scoped_refptr<GLImageIOSurface> image(new GLImageIOSurface( |
size, GLImageIOSurface::GetInternalFormatForTesting(format))); |
@@ -38,19 +38,39 @@ class GLImageIOSurfaceTestDelegate { |
return image; |
} |
+ |
+ static bool IsSupported(gfx::BufferFormat format) { |
+ switch (format) { |
+ case gfx::BufferFormat::RGBA_8888: |
+ case gfx::BufferFormat::BGRA_8888: |
+ case gfx::BufferFormat::YUV_420_BIPLANAR: |
+ return true; |
+ default: |
+ return false; |
+ } |
+ return false; |
+ } |
}; |
-using GLImageTestTypes = testing::Types< |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>>; |
+INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, |
+ GLImageTest, |
+ GLImageIOSurfaceTestDelegate); |
-INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageTest, GLImageTestTypes); |
+class GLImageIOSurfaceCopyTestDelegate : public GLImageIOSurfaceTestDelegate { |
+ static bool IsSupported(gfx::BufferFormat format) { |
+ switch (format) { |
+ case gfx::BufferFormat::YUV_420_BIPLANAR: |
+ return true; |
+ default: |
+ return false; |
+ } |
+ return false; |
+ } |
+}; |
-INSTANTIATE_TYPED_TEST_CASE_P( |
- GLImageIOSurface, |
- GLImageCopyTest, |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>); |
+INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, |
+ GLImageCopyTest, |
+ GLImageIOSurfaceCopyTestDelegate); |
} // namespace |
} // namespace gl |