by fbrier » Fri May 20, 2022 6:04 pm
OS: Currently Windows 10
CEF: 99.2.13
The code being run is drawn from the cefclient, not the cefclient itself, but I am calling SetAsWindowless(hwnd_) and setting windowless_rendering_enabled = true, when calling CefBrowserHost::CreateBrowser(). I've added lots of logging and the OsrRenderer OnPaint() and Render() methods are being called within the OsrRenderHandlerWinGL OnPaint, and those from within the CefRenderHandler OnPaint() method.
Thank you for pointing out where the format is specified. Would it work to change those lines (all 3 calls) from:
[line 324] glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width_, view_height_, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
[line 338] glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.width, rect.height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
[line 372] glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
to:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, view_width_, view_height_, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer);
glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.width, rect.height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer);
respectively? I tried it and it did NOT work (I did define GL_UNSIGNED_INT_8_8_8_8, using the value from glew.h). Still black, but either it is not an option, or I am missing something else. Is the use of GL_BGRA vs GL_RGBA for performance reasons? I can add some code to reverse the bytes in my client, but that is additional processing as well.