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

Unified Diff: ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc

Issue 1598573002: Propagate supported scanout formats from driver to SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
diff --git a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc b/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
index 27bb4a4ca1a62d43bb4dad8c9ca7936fb7184f07..068639b5ed4521c10305c428ed2f12683be83cb6 100644
--- a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
+++ b/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
@@ -8,7 +8,9 @@
#include "base/macros.h"
#include "ui/gfx/native_pixmap_handle_ozone.h"
+#include "ui/ozone/platform/drm/common/drm_util.h"
#include "ui/ozone/public/client_native_pixmap_factory.h" // nogncheck
+#include "ui/ozone/public/ozone_platform.h"
#if defined(USE_VGEM_MAP)
#include "ui/ozone/platform/drm/common/client_native_pixmap_vgem.h"
@@ -51,11 +53,14 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
gfx::BufferUsage usage) const override {
switch (usage) {
case gfx::BufferUsage::GPU_READ:
- case gfx::BufferUsage::SCANOUT:
- return format == gfx::BufferFormat::RGBA_8888 ||
- format == gfx::BufferFormat::RGBX_8888 ||
- format == gfx::BufferFormat::BGRA_8888 ||
- format == gfx::BufferFormat::BGRX_8888;
+ case gfx::BufferUsage::SCANOUT: {
+ std::vector<uint32_t> support_formats;
+ ui::OzonePlatform::GetInstance()->GetSupportedFormats(&support_formats);
spang 2016/01/18 18:14:31 The renderer process is allowed to have a ClientNa
william.xie 2016/01/19 04:40:16 Done.
+ return find(support_formats.begin(), support_formats.end(),
+ GetFourCCFormatForFramebuffer(format)) !=
+ support_formats.end();
+ }
+
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: {
#if defined(USE_VGEM_MAP)
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698