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

Unified Diff: gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc

Issue 1051503003: Add R_8 GPU memory buffers format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged on master. Created 5 years, 8 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 | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
index 9368da564997c3357bb7f3d10b6da64fc86353af..51b364041bd7071a2383d71a0dc5e827e02bd2c3 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -80,6 +80,9 @@ SHADER(
std::vector<uint8> GetTexturePixel(const gfx::GpuMemoryBuffer::Format format) {
std::vector<uint8> pixel;
switch (format) {
+ case gfx::GpuMemoryBuffer::R_8:
+ pixel.push_back(255u);
+ return pixel;
case gfx::GpuMemoryBuffer::RGBA_8888:
pixel.push_back(255u);
pixel.push_back(0u);
@@ -111,6 +114,7 @@ std::vector<uint8> GetFramebufferPixel(
const gfx::GpuMemoryBuffer::Format format) {
std::vector<uint8> pixel;
switch (format) {
+ case gfx::GpuMemoryBuffer::R_8:
case gfx::GpuMemoryBuffer::RGBA_8888:
case gfx::GpuMemoryBuffer::BGRA_8888:
pixel.push_back(255u);
@@ -135,6 +139,8 @@ std::vector<uint8> GetFramebufferPixel(
GLenum InternalFormat(gfx::GpuMemoryBuffer::Format format) {
switch (format) {
+ case gfx::GpuMemoryBuffer::R_8:
+ return GL_R8;
case gfx::GpuMemoryBuffer::RGBA_8888:
return GL_RGBA;
case gfx::GpuMemoryBuffer::BGRA_8888:
@@ -158,6 +164,9 @@ GLenum InternalFormat(gfx::GpuMemoryBuffer::Format format) {
// An end to end test that tests the whole GpuMemoryBuffer lifecycle.
TEST_P(GpuMemoryBufferTest, Lifecycle) {
+ ASSERT_TRUE((GetParam() != gfx::GpuMemoryBuffer::R_8) ||
+ gl_.GetCapabilities().texture_rg);
+
GLuint texture_id = 0;
glGenTextures(1, &texture_id);
ASSERT_NE(0u, texture_id);
@@ -243,7 +252,8 @@ TEST_P(GpuMemoryBufferTest, Lifecycle) {
INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests,
GpuMemoryBufferTest,
- ::testing::Values(gfx::GpuMemoryBuffer::RGBA_8888,
+ ::testing::Values(gfx::GpuMemoryBuffer::R_8,
+ gfx::GpuMemoryBuffer::RGBA_8888,
gfx::GpuMemoryBuffer::BGRA_8888));
} // namespace gles2
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698