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

Unified Diff: ui/ozone/platform/drm/common/drm_util.cc

Issue 1869793002: Ozone GBM: support R_8 format to GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT Created 4 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 | « 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 586571a1972405c38b15215468781269d3fe0d87..48885043deb9020ee6a6803eb66195555133bd2b 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -17,6 +17,9 @@
#define DRM_MODE_CONNECTOR_DSI 16
#endif
+// TODO(dshwang): after most linux and libdrm has this definition, remove it.
+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
dnicoara 2016/04/07 15:57:16 Surround it with #if-defs to avoid warnings when i
dshwang 2016/04/07 17:35:55 Done. guard by #ifndef DRM_FORMAT_R8
+
namespace ui {
namespace {
@@ -291,6 +294,8 @@ DisplaySnapshot_Params CreateDisplaySnapshotParams(
int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
switch (format) {
+ case gfx::BufferFormat::R_8:
+ return DRM_FORMAT_R8;
case gfx::BufferFormat::RGBA_8888:
return DRM_FORMAT_ABGR8888;
case gfx::BufferFormat::RGBX_8888:
@@ -309,6 +314,8 @@ int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
switch (format) {
+ case DRM_FORMAT_R8:
+ return gfx::BufferFormat::R_8;
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