Own Web platform services directly
This commit is contained in:
29
src/platform_legacy/legacy_platform_fallback_behavior.h
Normal file
29
src/platform_legacy/legacy_platform_fallback_behavior.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "legacy_ui_gl_dispatch.h"
|
||||
#include "platform_api/platform_services.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
|
||||
namespace pp::platform::legacy {
|
||||
|
||||
inline void bind_default_opengl_render_target()
|
||||
{
|
||||
pp::legacy::ui_gl::bind_opengl_framebuffer(
|
||||
pp::renderer::gl::framebuffer_target(),
|
||||
pp::renderer::gl::default_framebuffer_id());
|
||||
}
|
||||
|
||||
inline void complete_prepared_file_without_save(
|
||||
std::string_view path,
|
||||
const pp::platform::PreparedFileCallback& callback)
|
||||
{
|
||||
if (!callback)
|
||||
return;
|
||||
|
||||
callback(std::string(path), false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,11 +3,10 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "legacy_ui_gl_dispatch.h"
|
||||
#include "log.h"
|
||||
#include "platform_legacy/legacy_platform_fallback_behavior.h"
|
||||
#include "platform_api/network_tls_policy.h"
|
||||
#include "platform_api/platform_policy.h"
|
||||
#include "renderer_gl/opengl_capabilities.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -77,9 +76,7 @@ public:
|
||||
|
||||
void bind_default_render_target() override
|
||||
{
|
||||
pp::legacy::ui_gl::bind_opengl_framebuffer(
|
||||
pp::renderer::gl::framebuffer_target(),
|
||||
pp::renderer::gl::default_framebuffer_id());
|
||||
pp::platform::legacy::bind_default_opengl_render_target();
|
||||
}
|
||||
|
||||
void bind_main_render_target() override
|
||||
@@ -298,10 +295,8 @@ public:
|
||||
std::string_view suggested_name,
|
||||
pp::platform::PreparedFileCallback callback) override
|
||||
{
|
||||
const std::string value(path);
|
||||
const std::string name(suggested_name);
|
||||
(void)name;
|
||||
callback(value, false);
|
||||
(void)suggested_name;
|
||||
pp::platform::legacy::complete_prepared_file_without_save(path, callback);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user