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

Unified Diff: ui/ozone/gl/gl_image_ozone_native_pixmap.cc

Issue 2376293003: gpu: support RG_88 GpuMemoryBuffer (Closed)
Patch Set: resolve hubbe's review Created 4 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/test/gl_image_test_support.cc ('k') | ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/gl/gl_image_ozone_native_pixmap.cc
diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
index 4df05e7348cc099538fc1943941d0fc9d82527f5..238ff70b121c8447fe52ccc0e2255733551e3bee 100644
--- a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
+++ b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
@@ -14,6 +14,7 @@
(static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24))
#define DRM_FORMAT_R8 FOURCC('R', '8', ' ', ' ')
+#define DRM_FORMAT_GR88 FOURCC('G', 'R', '8', '8')
#define DRM_FORMAT_RGB565 FOURCC('R', 'G', '1', '6')
#define DRM_FORMAT_ARGB8888 FOURCC('A', 'R', '2', '4')
#define DRM_FORMAT_ABGR8888 FOURCC('A', 'B', '2', '4')
@@ -41,6 +42,8 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) {
return format == gfx::BufferFormat::BGRA_8888;
case GL_RED_EXT:
return format == gfx::BufferFormat::R_8;
+ case GL_RG_EXT:
+ return format == gfx::BufferFormat::RG_88;
default:
return false;
}
@@ -49,6 +52,7 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) {
bool ValidFormat(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::RGBX_8888:
@@ -75,6 +79,8 @@ EGLint FourCC(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
return DRM_FORMAT_R8;
+ case gfx::BufferFormat::RG_88:
+ return DRM_FORMAT_GR88;
case gfx::BufferFormat::BGR_565:
return DRM_FORMAT_RGB565;
case gfx::BufferFormat::RGBA_8888:
@@ -110,6 +116,7 @@ bool IsFormatCrCb(gfx::BufferFormat format) {
case gfx::BufferFormat::YVU_420:
return true;
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::RGBX_8888:
@@ -287,6 +294,8 @@ unsigned GLImageOzoneNativePixmap::GetInternalFormatForTesting(
switch (format) {
case gfx::BufferFormat::R_8:
return GL_RED_EXT;
+ case gfx::BufferFormat::RG_88:
+ return GL_RG_EXT;
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::BGRX_8888:
« no previous file with comments | « ui/gl/test/gl_image_test_support.cc ('k') | ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698