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

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

Issue 1389133002: content: Use type-parameterized tests for GpuMemoryBuffer implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add blankline Created 5 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
Index: ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
diff --git a/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc b/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
index af7042d44fdfe50159359bf1e690f757d73550b0..f5dfd78e31c2e086be0969cb9e17280a7f56d513 100644
--- a/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
+++ b/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
@@ -44,21 +44,23 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
vgem_fd_ = device_fd.Pass();
#endif
}
- std::vector<Configuration> GetSupportedConfigurations() const override {
- const Configuration kConfigurations[] = {
- {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT},
- {gfx::BufferFormat::BGRX_8888, gfx::BufferUsage::SCANOUT}};
- std::vector<Configuration> configurations(
- kConfigurations, kConfigurations + arraysize(kConfigurations));
+ bool IsConfigurationSupported(gfx::BufferFormat format,
+ gfx::BufferUsage usage) const override {
+ switch (usage) {
+ case gfx::BufferUsage::SCANOUT:
+ return format == gfx::BufferFormat::BGRA_8888 ||
+ format == gfx::BufferFormat::BGRX_8888;
+ case gfx::BufferUsage::MAP:
+ case gfx::BufferUsage::PERSISTENT_MAP: {
#if defined(USE_VGEM_MAP)
- if (vgem_fd_.is_valid()) {
- configurations.push_back(
- {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP});
- configurations.push_back(
- {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::PERSISTENT_MAP});
- }
+ return vgem_fd_.is_valid() && format == gfx::BufferFormat::BGRA_8888;
+#else
+ return false;
#endif
- return configurations;
+ }
+ }
+ NOTREACHED();
+ return false;
}
scoped_ptr<ClientNativePixmap> ImportFromHandle(
const gfx::NativePixmapHandle& handle,
« no previous file with comments | « ui/ozone/common/stub_client_native_pixmap_factory.cc ('k') | ui/ozone/public/client_native_pixmap_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698