mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Implement WebGL2's readPixels with a byte offset argument
We pass it in as a `void*` since that's what this API expects when you have bound the GL_PIXEL_PACK_BUFFER buffer.
This commit is contained in:
parent
7b5940d27d
commit
25d78f7c8e
Notes:
github-actions[bot]
2025-10-30 23:21:34 +00:00
Author: https://github.com/gmta
Commit: 25d78f7c8e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6637
3 changed files with 15 additions and 1 deletions
|
|
@ -1496,6 +1496,19 @@ void WebGL2RenderingContextImpl::read_pixels(WebIDL::Long x, WebIDL::Long y, Web
|
|||
glReadPixelsRobustANGLE(x, y, width, height, format, type, span.size(), nullptr, nullptr, nullptr, span.data());
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::read_pixels(WebIDL::Long x, WebIDL::Long y, WebIDL::Long width, WebIDL::Long height,
|
||||
WebIDL::UnsignedLong format, WebIDL::UnsignedLong type, WebIDL::LongLong offset)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
if (!m_pixel_pack_buffer_binding) {
|
||||
set_error(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
|
||||
glReadPixelsRobustANGLE(x, y, width, height, format, type, 0, nullptr, nullptr, nullptr, reinterpret_cast<void*>(offset));
|
||||
}
|
||||
|
||||
void WebGL2RenderingContextImpl::active_texture(WebIDL::UnsignedLong texture)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue