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

Unified Diff: ui/ozone/platform/drm/common/drm_util.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/ozone/platform/drm/client_native_pixmap_factory_gbm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/common/drm_util.cc
diff --git a/ui/ozone/platform/drm/common/drm_util.cc b/ui/ozone/platform/drm/common/drm_util.cc
index d13941ecf37474087fafc4caa8975edf60160014..c21ba96a84de83d57746508c2e04955f2cba5bfe 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -30,6 +30,10 @@
// TODO(dshwang): after most linux and libdrm has this definition, remove it.
#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
#endif
+#if !defined(DRM_FORMAT_GR88)
+// TODO(dshwang): after most linux and libdrm has this definition, remove it.
+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
+#endif
#if !defined(DRM_FORMAT_YV12)
// TODO(dcastagna): after libdrm has this definition, remove it.
#define DRM_FORMAT_YV12 fourcc_code('Y', 'V', '1', '2')
@@ -329,6 +333,8 @@ int GetFourCCFormatFromBufferFormat(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::RGBA_8888:
return DRM_FORMAT_ABGR8888;
case gfx::BufferFormat::RGBX_8888:
@@ -353,6 +359,8 @@ gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
switch (format) {
case DRM_FORMAT_R8:
return gfx::BufferFormat::R_8;
+ case DRM_FORMAT_GR88:
+ return gfx::BufferFormat::RG_88;
case DRM_FORMAT_ABGR8888:
return gfx::BufferFormat::RGBA_8888;
case DRM_FORMAT_XBGR8888:
« no previous file with comments | « ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698