From 6108b766b371a6e2261d7e2e130126a120fd4d05 Mon Sep 17 00:00:00 2001 From: Yuly Novikov Date: Thu, 8 Feb 2018 18:17:43 -0500 Subject: [PATCH] Remove angle::Library and its usages No longer needed after https://chromium-review.googlesource.com/513519 Loading libGLESv2 interferes with API tracing tools BUG=angleproject:1892,angleproject:2343 Change-Id: I2ccbc99377d75d107fd644301402c52466dded21 Reviewed-on: https://chromium-review.googlesource.com/910094 Reviewed-by: Jamie Madill Commit-Queue: Yuly Novikov --- src/tests/test_utils/ANGLETest.cpp | 5 --- src/tests/test_utils/ANGLETest.h | 3 -- util/posix/Posix_system_utils.cpp | 41 ----------------------- util/system_utils.h | 9 ----- util/windows/win32/Win32_system_utils.cpp | 41 ----------------------- util/windows/winrt/WinRT_system_utils.cpp | 6 ---- 6 files changed, 105 deletions(-) diff --git a/src/tests/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp index 13cc236dd..6a64882ef 100644 --- a/src/tests/test_utils/ANGLETest.cpp +++ b/src/tests/test_utils/ANGLETest.cpp @@ -929,8 +929,6 @@ bool ANGLETestBase::InitTestWindow() mOSWindow->setVisible(true); - mGLESLibrary.reset(angle::loadLibrary("libGLESv2")); - return true; } @@ -944,8 +942,6 @@ bool ANGLETestBase::DestroyTestWindow() mOSWindow = nullptr; } - mGLESLibrary.reset(nullptr); - return true; } @@ -1129,7 +1125,6 @@ ANGLETestBase::ScopedIgnorePlatformMessages::~ScopedIgnorePlatformMessages() OSWindow *ANGLETestBase::mOSWindow = nullptr; Optional ANGLETestBase::mLastRendererType; -std::unique_ptr ANGLETestBase::mGLESLibrary; void ANGLETestEnvironment::SetUp() { diff --git a/src/tests/test_utils/ANGLETest.h b/src/tests/test_utils/ANGLETest.h index eb0c5776c..9e6d308e5 100644 --- a/src/tests/test_utils/ANGLETest.h +++ b/src/tests/test_utils/ANGLETest.h @@ -391,9 +391,6 @@ class ANGLETestBase // Workaround for NVIDIA not being able to share a window with OpenGL and Vulkan. static Optional mLastRendererType; - - // For loading and freeing platform - static std::unique_ptr mGLESLibrary; }; class ANGLETest : public ANGLETestBase, public ::testing::TestWithParam diff --git a/util/posix/Posix_system_utils.cpp b/util/posix/Posix_system_utils.cpp index 010735b3b..ed9e817d5 100644 --- a/util/posix/Posix_system_utils.cpp +++ b/util/posix/Posix_system_utils.cpp @@ -47,45 +47,4 @@ void WriteDebugMessage(const char *format, ...) // TODO(jmadill): Implement this } -class PosixLibrary : public Library -{ - public: - PosixLibrary(const std::string &libraryName); - ~PosixLibrary() override; - - void *getSymbol(const std::string &symbolName) override; - - private: - void *mModule; -}; - -PosixLibrary::PosixLibrary(const std::string &libraryName) : mModule(nullptr) -{ - const auto &fullName = libraryName + "." + GetSharedLibraryExtension(); - mModule = dlopen(fullName.c_str(), RTLD_NOW); -} - -PosixLibrary::~PosixLibrary() -{ - if (mModule) - { - dlclose(mModule); - } -} - -void *PosixLibrary::getSymbol(const std::string &symbolName) -{ - if (!mModule) - { - return nullptr; - } - - return dlsym(mModule, symbolName.c_str()); -} - -Library *loadLibrary(const std::string &libraryName) -{ - return new PosixLibrary(libraryName); -} - } // namespace angle diff --git a/util/system_utils.h b/util/system_utils.h index 1da43b810..b0d49cb3e 100644 --- a/util/system_utils.h +++ b/util/system_utils.h @@ -27,15 +27,6 @@ ANGLE_EXPORT void SetLowPriorityProcess(); // Write a debug message, either to a standard output or Debug window. ANGLE_EXPORT void WriteDebugMessage(const char *format, ...); -class ANGLE_EXPORT Library : angle::NonCopyable -{ - public: - virtual ~Library() {} - virtual void *getSymbol(const std::string &symbolName) = 0; -}; - -ANGLE_EXPORT Library *loadLibrary(const std::string &libraryName); - } // namespace angle #endif // UTIL_SYSTEM_UTILS_H_ diff --git a/util/windows/win32/Win32_system_utils.cpp b/util/windows/win32/Win32_system_utils.cpp index a9fd97fe7..39807baa7 100644 --- a/util/windows/win32/Win32_system_utils.cpp +++ b/util/windows/win32/Win32_system_utils.cpp @@ -19,45 +19,4 @@ void SetLowPriorityProcess() SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); } -class Win32Library : public Library -{ - public: - Win32Library(const std::string &libraryName); - ~Win32Library() override; - - void *getSymbol(const std::string &symbolName) override; - - private: - HMODULE mModule; -}; - -Win32Library::Win32Library(const std::string &libraryName) : mModule(nullptr) -{ - const auto &fullName = libraryName + "." + GetSharedLibraryExtension(); - mModule = LoadLibraryA(fullName.c_str()); -} - -Win32Library::~Win32Library() -{ - if (mModule) - { - FreeLibrary(mModule); - } -} - -void *Win32Library::getSymbol(const std::string &symbolName) -{ - if (!mModule) - { - return nullptr; - } - - return GetProcAddress(mModule, symbolName.c_str()); -} - -Library *loadLibrary(const std::string &libraryName) -{ - return new Win32Library(libraryName); -} - } // namespace angle diff --git a/util/windows/winrt/WinRT_system_utils.cpp b/util/windows/winrt/WinRT_system_utils.cpp index 8513bacd9..593c5f465 100644 --- a/util/windows/winrt/WinRT_system_utils.cpp +++ b/util/windows/winrt/WinRT_system_utils.cpp @@ -19,10 +19,4 @@ void SetLowPriorityProcess() // No equivalent to this in WinRT } -Library *loadLibrary(const std::string &libraryName) -{ - // WinRT cannot load code dynamically. - return nullptr; -} - } // namespace angle