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

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

Issue 1483633002: ozone: support gfx::BufferFormat::RGBX_8888 as a native pixmap format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gl_image_ozone_native_pixmap also, which gl_unittests check Created 5 years 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/common/drm_util.h ('k') | ui/ozone/platform/drm/gpu/drm_window.cc » ('j') | 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 57f3488fbc807d9b2058052f75843200806a7b16..78dbbc3c74699fe5f7d0dd4a9025f19f72be860e 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -273,6 +273,10 @@ DisplaySnapshot_Params CreateDisplaySnapshotParams(
int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
switch (format) {
+ case gfx::BufferFormat::RGBA_8888:
+ return DRM_FORMAT_ABGR8888;
+ case gfx::BufferFormat::RGBX_8888:
+ return DRM_FORMAT_XBGR8888;
case gfx::BufferFormat::BGRA_8888:
return DRM_FORMAT_ARGB8888;
case gfx::BufferFormat::BGRX_8888:
@@ -287,6 +291,10 @@ int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
switch (format) {
+ case DRM_FORMAT_ABGR8888:
+ return gfx::BufferFormat::RGBA_8888;
+ case DRM_FORMAT_XBGR8888:
+ return gfx::BufferFormat::RGBX_8888;
case DRM_FORMAT_ARGB8888:
return gfx::BufferFormat::BGRA_8888;
case DRM_FORMAT_XRGB8888:
@@ -298,4 +306,21 @@ gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
return gfx::BufferFormat::BGRA_8888;
}
}
+
+int GetFourCCFormatForFramebuffer(gfx::BufferFormat format) {
+ // Currently, drm supports 24 bitcolordepth for hardware overlay.
+ switch (format) {
+ case gfx::BufferFormat::RGBA_8888:
+ case gfx::BufferFormat::RGBX_8888:
+ return DRM_FORMAT_XBGR8888;
+ case gfx::BufferFormat::BGRA_8888:
+ case gfx::BufferFormat::BGRX_8888:
+ return DRM_FORMAT_XRGB8888;
+ case gfx::BufferFormat::UYVY_422:
+ return DRM_FORMAT_UYVY;
+ default:
+ NOTREACHED();
+ return 0;
+ }
+}
} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/common/drm_util.h ('k') | ui/ozone/platform/drm/gpu/drm_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698