Commit 6108b766 by Yuly Novikov Committed by Commit Bot

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/910094Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 41b072b6
...@@ -929,8 +929,6 @@ bool ANGLETestBase::InitTestWindow() ...@@ -929,8 +929,6 @@ bool ANGLETestBase::InitTestWindow()
mOSWindow->setVisible(true); mOSWindow->setVisible(true);
mGLESLibrary.reset(angle::loadLibrary("libGLESv2"));
return true; return true;
} }
...@@ -944,8 +942,6 @@ bool ANGLETestBase::DestroyTestWindow() ...@@ -944,8 +942,6 @@ bool ANGLETestBase::DestroyTestWindow()
mOSWindow = nullptr; mOSWindow = nullptr;
} }
mGLESLibrary.reset(nullptr);
return true; return true;
} }
...@@ -1129,7 +1125,6 @@ ANGLETestBase::ScopedIgnorePlatformMessages::~ScopedIgnorePlatformMessages() ...@@ -1129,7 +1125,6 @@ ANGLETestBase::ScopedIgnorePlatformMessages::~ScopedIgnorePlatformMessages()
OSWindow *ANGLETestBase::mOSWindow = nullptr; OSWindow *ANGLETestBase::mOSWindow = nullptr;
Optional<EGLint> ANGLETestBase::mLastRendererType; Optional<EGLint> ANGLETestBase::mLastRendererType;
std::unique_ptr<angle::Library> ANGLETestBase::mGLESLibrary;
void ANGLETestEnvironment::SetUp() void ANGLETestEnvironment::SetUp()
{ {
......
...@@ -391,9 +391,6 @@ class ANGLETestBase ...@@ -391,9 +391,6 @@ class ANGLETestBase
// Workaround for NVIDIA not being able to share a window with OpenGL and Vulkan. // Workaround for NVIDIA not being able to share a window with OpenGL and Vulkan.
static Optional<EGLint> mLastRendererType; static Optional<EGLint> mLastRendererType;
// For loading and freeing platform
static std::unique_ptr<angle::Library> mGLESLibrary;
}; };
class ANGLETest : public ANGLETestBase, public ::testing::TestWithParam<angle::PlatformParameters> class ANGLETest : public ANGLETestBase, public ::testing::TestWithParam<angle::PlatformParameters>
......
...@@ -47,45 +47,4 @@ void WriteDebugMessage(const char *format, ...) ...@@ -47,45 +47,4 @@ void WriteDebugMessage(const char *format, ...)
// TODO(jmadill): Implement this // 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 } // namespace angle
...@@ -27,15 +27,6 @@ ANGLE_EXPORT void SetLowPriorityProcess(); ...@@ -27,15 +27,6 @@ ANGLE_EXPORT void SetLowPriorityProcess();
// Write a debug message, either to a standard output or Debug window. // Write a debug message, either to a standard output or Debug window.
ANGLE_EXPORT void WriteDebugMessage(const char *format, ...); 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 } // namespace angle
#endif // UTIL_SYSTEM_UTILS_H_ #endif // UTIL_SYSTEM_UTILS_H_
...@@ -19,45 +19,4 @@ void SetLowPriorityProcess() ...@@ -19,45 +19,4 @@ void SetLowPriorityProcess()
SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); 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 } // namespace angle
...@@ -19,10 +19,4 @@ void SetLowPriorityProcess() ...@@ -19,10 +19,4 @@ void SetLowPriorityProcess()
// No equivalent to this in WinRT // No equivalent to this in WinRT
} }
Library *loadLibrary(const std::string &libraryName)
{
// WinRT cannot load code dynamically.
return nullptr;
}
} // namespace angle } // namespace angle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment