128 {
130 VALIDATION_LOG <<
"Only textures with pixel format RGBA are supported yet.";
131 return false;
132 }
133
134 const auto&
gl = reactor.GetProcTable();
135
136 GLuint read_fbo = GL_NONE;
138 [&gl, &read_fbo]() {
DeleteFBO(gl, read_fbo, GL_READ_FRAMEBUFFER); });
139
140 {
142 if (!
read.has_value()) {
143 return false;
144 }
145 read_fbo =
read.value();
146 }
147
153 });
154
155 return true;
156};
static bool read(SkStream *stream, void *buffer, size_t amount)
Wraps a closure that is invoked in the destructor unless released by the caller.
static DeviceBufferGLES & Cast(DeviceBuffer &base)
void UpdateBufferData(const std::function< void(uint8_t *, size_t length)> &update_buffer_data)
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)
std::shared_ptr< DeviceBuffer > destination
std::shared_ptr< Texture > source
size_t destination_offset
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|.