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

Unified Diff: ui/gl/gl_image_ref_counted_memory_unittest.cc

Issue 1415723006: ui: Add RGBX_8888 buffer format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gles but no conversion needed case Created 5 years, 2 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_image_ozone_native_pixmap.cc ('k') | ui/gl/gl_image_shared_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_ref_counted_memory_unittest.cc
diff --git a/ui/gl/gl_image_ref_counted_memory_unittest.cc b/ui/gl/gl_image_ref_counted_memory_unittest.cc
index c3d77e2b1cb34aa19a64d7b5d8fefe54fe31cef3..be25e63754bd16923ee6a6b049ffab3fbd59b1b3 100644
--- a/ui/gl/gl_image_ref_counted_memory_unittest.cc
+++ b/ui/gl/gl_image_ref_counted_memory_unittest.cc
@@ -12,11 +12,10 @@
namespace gfx {
namespace {
+template <BufferFormat format>
class GLImageRefCountedMemoryTestDelegate {
public:
scoped_refptr<GLImage> CreateSolidColorImage(const Size& size,
- unsigned internalformat,
- BufferFormat format,
const uint8_t color[4]) const {
DCHECK_EQ(NumberOfPlanesForBufferFormat(format), 1u);
std::vector<uint8_t> data(BufferSizeForBufferFormat(size, format));
@@ -25,21 +24,27 @@ class GLImageRefCountedMemoryTestDelegate {
size.width(), size.height(),
static_cast<int>(RowSizeForBufferFormat(size.width(), format, 0)),
format, color, &bytes->data().front());
- scoped_refptr<GLImageRefCountedMemory> image(
- new GLImageRefCountedMemory(size, internalformat));
+ scoped_refptr<GLImageRefCountedMemory> image(new GLImageRefCountedMemory(
+ size, GLImageMemory::GetInternalFormatForTesting(format)));
bool rv = image->Initialize(bytes.get(), format);
EXPECT_TRUE(rv);
return image;
}
};
+using GLImageTestTypes = testing::Types<
+ GLImageRefCountedMemoryTestDelegate<BufferFormat::RGBX_8888>,
+ GLImageRefCountedMemoryTestDelegate<BufferFormat::RGBA_8888>,
+ GLImageRefCountedMemoryTestDelegate<BufferFormat::BGRX_8888>,
+ GLImageRefCountedMemoryTestDelegate<BufferFormat::BGRA_8888>>;
+
INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory,
GLImageTest,
- GLImageRefCountedMemoryTestDelegate);
+ GLImageTestTypes);
INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory,
GLImageCopyTest,
- GLImageRefCountedMemoryTestDelegate);
+ GLImageTestTypes);
} // namespace
} // namespace gfx
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.cc ('k') | ui/gl/gl_image_shared_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698