mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb/WebGL: Respect subarrays in readPixels
This commit is contained in:
parent
71746c47c2
commit
876d26c32e
Notes:
github-actions[bot]
2025-01-08 14:56:28 +00:00
Author: https://github.com/Lubrsi
Commit: 876d26c32e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2943
Reviewed-by: https://github.com/kalenikaliaksandr
1 changed files with 1 additions and 11 deletions
|
@ -1036,17 +1036,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *ptr = nullptr;
|
void *ptr = pixels->viewed_array_buffer()->buffer().data() + pixels->byte_offset();
|
||||||
if (pixels->is_data_view()) {
|
|
||||||
auto& data_view = static_cast<JS::DataView&>(*pixels->raw_object());
|
|
||||||
ptr = data_view.viewed_array_buffer()->buffer().data();
|
|
||||||
} else if (pixels->is_typed_array_base()) {
|
|
||||||
auto& typed_array_base = static_cast<JS::TypedArrayBase&>(*pixels->raw_object());
|
|
||||||
ptr = typed_array_base.viewed_array_buffer()->buffer().data();
|
|
||||||
} else {
|
|
||||||
VERIFY_NOT_REACHED();
|
|
||||||
}
|
|
||||||
|
|
||||||
glReadPixels(x, y, width, height, format, type, ptr);
|
glReadPixels(x, y, width, height, format, type, ptr);
|
||||||
)~~~");
|
)~~~");
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue