summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorandresantoso <andresantoso@chromium.org>2015-08-12 14:08:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-12 21:09:31 +0000
commitf7a3b9416464e0c7384a6387caaeed230bc77a39 (patch)
tree82e3e6095eb091e1dd6cbf01a9303647436d87e6 /gpu
parent8948d0831d3c4d3e793879b5aad6f03a5b89353d (diff)
downloadchromium_src-f7a3b9416464e0c7384a6387caaeed230bc77a39.zip
chromium_src-f7a3b9416464e0c7384a6387caaeed230bc77a39.tar.gz
chromium_src-f7a3b9416464e0c7384a6387caaeed230bc77a39.tar.bz2
Add YUV_420_BIPLANAR to gfx::BufferFormat.
Enable it as a supported configuration on Mac. BUG=510260 TEST=Covered by GpuMemoryBufferImpl::Map and ::PersistentMap. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1282313002 Cr-Commit-Position: refs/heads/master@{#343093}
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/image_factory.cc2
-rw-r--r--gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc2
-rw-r--r--gpu/command_buffer/tests/gl_manager.cc7
3 files changed, 11 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/image_factory.cc b/gpu/command_buffer/service/image_factory.cc
index 9d4e659..a1a3f15 100644
--- a/gpu/command_buffer/service/image_factory.cc
+++ b/gpu/command_buffer/service/image_factory.cc
@@ -88,6 +88,7 @@ bool ImageFactory::IsGpuMemoryBufferFormatSupported(
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::YUV_420:
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
return true;
}
@@ -115,6 +116,7 @@ bool ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(
case gfx::BufferFormat::RGBX_8888:
return true;
case gfx::BufferFormat::YUV_420:
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
// U and V planes are subsampled by a factor of 2.
return size.width() % 2 == 0 && size.height() % 2 == 0;
}
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 d544d10..4d6f933 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -114,6 +114,7 @@ void SetRow(gfx::BufferFormat format,
case gfx::BufferFormat::ETC1:
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::YUV_420:
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
NOTREACHED();
return;
}
@@ -137,6 +138,7 @@ GLenum InternalFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::ETC1:
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::YUV_420:
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
NOTREACHED();
return 0;
}
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 5489358..7897d16 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -58,6 +58,11 @@ size_t SubsamplingFactor(gfx::BufferFormat format, int plane) {
DCHECK_LT(static_cast<size_t>(plane), arraysize(factor));
return factor[plane];
}
+ case gfx::BufferFormat::YUV_420_BIPLANAR: {
+ static size_t factor[] = {1, 2};
+ DCHECK_LT(static_cast<size_t>(plane), arraysize(factor));
+ return factor[plane];
+ }
}
NOTREACHED();
return 0;
@@ -89,6 +94,8 @@ size_t StrideInBytes(size_t width, gfx::BufferFormat format, int plane) {
return 0;
case gfx::BufferFormat::YUV_420:
return width / SubsamplingFactor(format, plane);
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ return width;
}
NOTREACHED();