mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05: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: https://github.com/LadybirdBrowser/ladybird/commit/876d26c32e4 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;
|
||||
}
|
||||
|
||||
void *ptr = nullptr;
|
||||
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();
|
||||
}
|
||||
|
||||
void *ptr = pixels->viewed_array_buffer()->buffer().data() + pixels->byte_offset();
|
||||
glReadPixels(x, y, width, height, format, type, ptr);
|
||||
)~~~");
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue