diff options
| author | 2017-11-17 20:33:25 +0000 | |
|---|---|---|
| committer | 2017-11-17 20:33:25 +0000 | |
| commit | a5bafdc511e774ca10bbfb07db88a1e03cc094e7 (patch) | |
| tree | 7fdf7926c9d85a5668d52ea8dc87f51709c93583 /libs | |
| parent | 91601ac498b70af52ad262002aef8bd903acc24a (diff) | |
| parent | d2aa3ab0f37087ab784a0a9246cc6ec5f04a3abe (diff) | |
Merge "Rootless GPU Debug"
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/graphicsenv/GraphicsEnv.cpp | 27 | ||||
| -rw-r--r-- | libs/graphicsenv/include/graphicsenv/GraphicsEnv.h | 10 |
2 files changed, 37 insertions, 0 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp index 39b5829faf..f46e9f6c53 100644 --- a/libs/graphicsenv/GraphicsEnv.cpp +++ b/libs/graphicsenv/GraphicsEnv.cpp @@ -22,6 +22,7 @@ #include <log/log.h> #include <nativeloader/dlext_namespaces.h> +#include <nativeloader/native_loader.h> // TODO(b/37049319) Get this from a header once one exists extern "C" { @@ -45,6 +46,32 @@ void GraphicsEnv::setDriverPath(const std::string path) { mDriverPath = path; } +void GraphicsEnv::setLayerPaths(android_namespace_t* appNamespace, const std::string layerPaths) { + if (mLayerPaths.empty()) { + mLayerPaths = layerPaths; + mAppNamespace = appNamespace; + } else { + ALOGV("Vulkan layer search path already set, not clobbering with '%s' for namespace %p'", + layerPaths.c_str(), appNamespace); + } +} + +android_namespace_t* GraphicsEnv::getAppNamespace() { + return mAppNamespace; +} + +const std::string GraphicsEnv::getLayerPaths(){ + return mLayerPaths; +} + +const std::string GraphicsEnv::getDebugLayers() { + return mDebugLayers; +} + +void GraphicsEnv::setDebugLayers(const std::string layers) { + mDebugLayers = layers; +} + android_namespace_t* GraphicsEnv::getDriverNamespace() { static std::once_flag once; std::call_once(once, [this]() { diff --git a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h index 781707694a..213580c20b 100644 --- a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h +++ b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h @@ -35,10 +35,20 @@ public: void setDriverPath(const std::string path); android_namespace_t* getDriverNamespace(); + void setLayerPaths(android_namespace_t* appNamespace, const std::string layerPaths); + android_namespace_t* getAppNamespace(); + const std::string getLayerPaths(); + + void setDebugLayers(const std::string layers); + const std::string getDebugLayers(); + private: GraphicsEnv() = default; std::string mDriverPath; + std::string mDebugLayers; + std::string mLayerPaths; android_namespace_t* mDriverNamespace = nullptr; + android_namespace_t* mAppNamespace = nullptr; }; } // namespace android |