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

Unified Diff: ui/ozone/platform/dri/ozone_platform_gbm.cc

Issue 310673002: ozone: gbm: Fix libglapi linkage errors under gbm (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/ozone_platform_gbm.cc
diff --git a/ui/ozone/platform/dri/ozone_platform_gbm.cc b/ui/ozone/platform/dri/ozone_platform_gbm.cc
index 75f05515bd098cd5d955925fde5cac7d53e1350a..56c1744c19cbb27190ae8134f957cf5d2475ee83 100644
--- a/ui/ozone/platform/dri/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc
@@ -4,6 +4,7 @@
#include "ui/ozone/platform/dri/ozone_platform_gbm.h"
+#include <dlfcn.h>
#include <stdlib.h>
#include <gbm.h>
@@ -32,9 +33,12 @@ class GbmSurfaceGenerator : public ScanoutSurfaceGenerator {
public:
GbmSurfaceGenerator(DriWrapper* dri)
: dri_(dri),
+ glapi_lib_(dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL)),
device_(gbm_create_device(dri_->get_fd())) {}
virtual ~GbmSurfaceGenerator() {
gbm_device_destroy(device_);
+ if (glapi_lib_)
+ dlclose(glapi_lib_);
}
gbm_device* device() const { return device_; }
@@ -46,6 +50,9 @@ class GbmSurfaceGenerator : public ScanoutSurfaceGenerator {
private:
DriWrapper* dri_; // Not owned.
+ // HACK: gbm drivers have broken linkage
+ void *glapi_lib_;
+
gbm_device* device_;
DISALLOW_COPY_AND_ASSIGN(GbmSurfaceGenerator);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698