Chromium Code Reviews| 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: |