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

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

Issue 1248713002: ozone: ClientPixmapManager passes VGEM fd from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to latest crrev.com/1128113011 Created 5 years, 5 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_manager_gbm.cc
diff --git a/ui/ozone/platform/drm/common/client_native_pixmap_manager_gbm.cc b/ui/ozone/platform/drm/common/client_native_pixmap_manager_gbm.cc
index c73c4ddf10dce5c586d30b1d7a9247457d6e6756..cb00494b719771de4bb93d905bfdccc2055c5a86 100644
--- a/ui/ozone/platform/drm/common/client_native_pixmap_manager_gbm.cc
+++ b/ui/ozone/platform/drm/common/client_native_pixmap_manager_gbm.cc
@@ -14,7 +14,11 @@ namespace {
class ClientNativePixmapManagerGbm : public ClientNativePixmapManager {
public:
ClientNativePixmapManagerGbm() {}
- ~ClientNativePixmapManagerGbm() override {}
+ ~ClientNativePixmapManagerGbm() override {
+ if (vgem_fd_.auto_close) {
+ base::ScopedFD closing_fd(vgem_fd_.fd);
+ }
+ }
// ClientNativePixmapManager:
std::vector<Configuration> GetSupportedConfigurations() const override {
@@ -33,6 +37,14 @@ class ClientNativePixmapManagerGbm : public ClientNativePixmapManager {
}
private:
+ void Initialize(const base::FileDescriptor& virtual_device) override {
+ DCHECK_EQ(vgem_fd_.fd, -1);
+ if (virtual_device.fd >= 0)
+ vgem_fd_ = virtual_device;
+ }
+
+ base::FileDescriptor vgem_fd_;
+
DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapManagerGbm);
};

Powered by Google App Engine
This is Rietveld 408576698