Share retained GL runtime dispatch adapters
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "app.h"
|
||||
#include "app_core/document_platform_io.h"
|
||||
#include "legacy_ui_gl_dispatch.h"
|
||||
#include "log.h"
|
||||
#include "platform_api/network_tls_policy.h"
|
||||
#include "platform_api/platform_policy.h"
|
||||
@@ -59,11 +60,6 @@ void invoke_picked_path_if_selected(
|
||||
callback(path);
|
||||
}
|
||||
|
||||
void enable_gl_capability(std::uint32_t state) noexcept
|
||||
{
|
||||
glEnable(static_cast<GLenum>(state));
|
||||
}
|
||||
|
||||
// DEBT-0017: fallback for platforms that do not inject PlatformServices yet.
|
||||
class LegacyPlatformServices final : public pp::platform::PlatformServices {
|
||||
public:
|
||||
@@ -249,8 +245,8 @@ public:
|
||||
|
||||
void bind_default_render_target() override
|
||||
{
|
||||
glBindFramebuffer(
|
||||
static_cast<GLenum>(pp::renderer::gl::framebuffer_target()),
|
||||
pp::legacy::ui_gl::bind_opengl_framebuffer(
|
||||
pp::renderer::gl::framebuffer_target(),
|
||||
pp::renderer::gl::default_framebuffer_id());
|
||||
}
|
||||
|
||||
@@ -268,7 +264,7 @@ public:
|
||||
#if defined(__OSX__)
|
||||
const auto status = pp::renderer::gl::apply_opengl_render_platform_hints(
|
||||
pp::renderer::gl::OpenGlRenderPlatformHintDispatch {
|
||||
.enable = enable_gl_capability,
|
||||
.enable = pp::legacy::ui_gl::enable_opengl_state,
|
||||
});
|
||||
if (!status.ok())
|
||||
LOG("OpenGL legacy render platform hints failed: %s", status.message);
|
||||
|
||||
Reference in New Issue
Block a user