Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: ui/gl/gl_image_io_surface_unittest.cc

Issue 1484473003: gl, ozone: enable GLImageBindTest unittests Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix for win and mac, but cros need crrev.com/1208603002 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_image_memory.h » ('j') | ui/gl/gl_utils.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 487366fd8a1930d680455b319e89a7d5871d8952..2c14b2bce2428254498597a0a0a23484f3afcd00 100644
--- a/ui/gl/gl_image_io_surface_unittest.cc
+++ b/ui/gl/gl_image_io_surface_unittest.cc
@@ -14,10 +14,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)));
@@ -40,19 +40,42 @@ 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;
+ }
+ NOTREACHED();
+ 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 {
+ public:
+ static bool IsSupported(gfx::BufferFormat format) {
+ switch (format) {
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ return true;
+ default:
+ return false;
+ }
+ NOTREACHED();
+ 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
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_image_memory.h » ('j') | ui/gl/gl_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698