Add more error printing to know why command buffer lib failed to load.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2233073002 Review-Url: https://codereview.chromium.org/2233073002
This commit is contained in:
parent
1d65fe2932
commit
80e38ac117
@ -12,7 +12,11 @@
|
||||
#include <dlfcn.h>
|
||||
|
||||
void* DynamicLoadLibrary(const char* libraryName) {
|
||||
return dlopen(libraryName, RTLD_LAZY);
|
||||
void* result = dlopen(libraryName, RTLD_LAZY);
|
||||
if (!result) {
|
||||
SkDebugf("Error loading %s {\n %s\n}\n", libraryName, dlerror());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void* GetProcedureAddress(void* library, const char* functionName) {
|
||||
|
@ -88,13 +88,15 @@ static bool gfFunctionsLoadedSuccessfully = false;
|
||||
namespace {
|
||||
static void load_command_buffer_functions() {
|
||||
if (!gLibrary) {
|
||||
static constexpr const char* libName =
|
||||
#if defined _WIN32
|
||||
gLibrary = DynamicLoadLibrary("command_buffer_gles2.dll");
|
||||
"command_buffer_gles2.dll";
|
||||
#elif defined SK_BUILD_FOR_MAC
|
||||
gLibrary = DynamicLoadLibrary("libcommand_buffer_gles2.dylib");
|
||||
"libcommand_buffer_gles2.dylib";
|
||||
#else
|
||||
gLibrary = DynamicLoadLibrary("libcommand_buffer_gles2.so");
|
||||
"libcommand_buffer_gles2.so";
|
||||
#endif // defined _WIN32
|
||||
gLibrary = DynamicLoadLibrary(libName);
|
||||
if (gLibrary) {
|
||||
gfGetDisplay = (GetDisplayProc)GetProcedureAddress(gLibrary, "eglGetDisplay");
|
||||
gfInitialize = (InitializeProc)GetProcedureAddress(gLibrary, "eglInitialize");
|
||||
@ -116,6 +118,8 @@ static void load_command_buffer_functions() {
|
||||
gfCreateContext && gfDestroyContext && gfMakeCurrent &&
|
||||
gfSwapBuffers && gfGetProcAddress;
|
||||
|
||||
} else {
|
||||
SkDebugf("Could not load %s.\n", libName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user