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

Unified Diff: ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc

Issue 2711933002: Rename ClientNativePixmapFactoryGbm to ClientNativePixmapFactoryDmabuf amd move to ui/gfx (Closed)
Patch Set: Addressed sadrul's remark Created 3 years, 9 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/gfx/linux/client_native_pixmap_factory_dmabuf.h ('k') | ui/ozone/platform/drm/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc
diff --git a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc b/ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc
similarity index 73%
copy from ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
copy to ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc
index 090b048c29c36ded3e8f0c04192ec9ace1a4ca5f..a91e50645fe50e971e647879c5ce6afb75296879 100644
--- a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
+++ b/ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc
@@ -2,24 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/ozone/platform/drm/client_native_pixmap_factory_gbm.h"
+#include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h"
#include <utility>
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "ui/gfx/client_native_pixmap_factory.h"
+#include "base/trace_event/trace_event.h"
#include "ui/gfx/native_pixmap_handle.h"
-#include "ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h"
-namespace ui {
+#if defined(OS_CHROMEOS)
+// This can be enabled on all linux but it is not a requirement to support
+// glCreateImageChromium+Dmabuf since it uses gfx::BufferUsage::SCANOUT and
+// the pixmap does not need to be mappable on the client side.
+#include "ui/gfx/linux/client_native_pixmap_dmabuf.h"
+#endif
+
+namespace gfx {
namespace {
-class ClientNativePixmapGbm : public gfx::ClientNativePixmap {
+class ClientNativePixmapOpaque : public ClientNativePixmap {
public:
- ClientNativePixmapGbm() {}
- ~ClientNativePixmapGbm() override {}
+ ClientNativePixmapOpaque() {}
+ ~ClientNativePixmapOpaque() override {}
bool Map() override {
NOTREACHED();
@@ -38,10 +44,10 @@ class ClientNativePixmapGbm : public gfx::ClientNativePixmap {
} // namespace
-class ClientNativePixmapFactoryGbm : public gfx::ClientNativePixmapFactory {
+class ClientNativePixmapFactoryDmabuf : public ClientNativePixmapFactory {
public:
- ClientNativePixmapFactoryGbm() {}
- ~ClientNativePixmapFactoryGbm() override {}
+ ClientNativePixmapFactoryDmabuf() {}
+ ~ClientNativePixmapFactoryDmabuf() override {}
// ClientNativePixmapFactory:
bool IsConfigurationSupported(gfx::BufferFormat format,
@@ -81,7 +87,7 @@ class ClientNativePixmapFactoryGbm : public gfx::ClientNativePixmapFactory {
NOTREACHED();
return false;
}
- std::unique_ptr<gfx::ClientNativePixmap> ImportFromHandle(
+ std::unique_ptr<ClientNativePixmap> ImportFromHandle(
const gfx::NativePixmapHandle& handle,
const gfx::Size& size,
gfx::BufferUsage usage) override {
@@ -101,17 +107,17 @@ class ClientNativePixmapFactoryGbm : public gfx::ClientNativePixmapFactory {
// Close all the fds.
for (const auto& fd : handle.fds)
base::ScopedFD scoped_fd(fd.fd);
- return base::WrapUnique(new ClientNativePixmapGbm);
+ return base::WrapUnique(new ClientNativePixmapOpaque);
}
NOTREACHED();
return nullptr;
}
- DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm);
+ DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryDmabuf);
};
-gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() {
- return new ClientNativePixmapFactoryGbm();
+ClientNativePixmapFactory* CreateClientNativePixmapFactoryDmabuf() {
+ return new ClientNativePixmapFactoryDmabuf();
}
-} // namespace ui
+} // namespace gfx
« no previous file with comments | « ui/gfx/linux/client_native_pixmap_factory_dmabuf.h ('k') | ui/ozone/platform/drm/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698