67 {
68 const auto&
gl = reactor.GetProcTable();
69
70
71
72 if (!
gl.BlitFramebuffer.IsAvailable()) {
73
74 FML_LOG(
ERROR) <<
"Texture blit fallback not implemented yet for GLES2.";
75 return false;
76 }
77
78 GLuint read_fbo = GL_NONE;
79 GLuint draw_fbo = GL_NONE;
81 DeleteFBO(gl, read_fbo, GL_READ_FRAMEBUFFER);
82 DeleteFBO(gl, draw_fbo, GL_DRAW_FRAMEBUFFER);
83 });
84
85 {
87 if (!
read.has_value()) {
88 return false;
89 }
90 read_fbo =
read.value();
91 }
92
93 {
95 if (!
draw.has_value()) {
96 return false;
97 }
98 draw_fbo =
draw.value();
99 }
100
101 gl.Disable(GL_SCISSOR_TEST);
102 gl.Disable(GL_DEPTH_TEST);
103 gl.Disable(GL_STENCIL_TEST);
104
113 GL_COLOR_BUFFER_BIT,
114 GL_NEAREST
115 );
116
117 return true;
118};
static bool read(SkStream *stream, void *buffer, size_t amount)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Wraps a closure that is invoked in the destructor unless released by the caller.
#define FML_LOG(severity)
static std::optional< GLuint > ConfigureFBO(const ProcTableGLES &gl, const std::shared_ptr< Texture > &texture, GLenum fbo_type)
static void DeleteFBO(const ProcTableGLES &gl, GLuint fbo, GLenum type)
IPoint destination_origin
std::shared_ptr< Texture > destination
std::shared_ptr< Texture > source
constexpr Type GetY() const
Returns the Y coordinate of the upper left corner, equivalent to |GetOrigin().y|.
constexpr Type GetHeight() const
Returns the height of the rectangle, equivalent to |GetSize().height|.
constexpr Type GetX() const
Returns the X coordinate of the upper left corner, equivalent to |GetOrigin().x|.
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.