mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 08:06:11 +00:00
LibJS+LibWeb: Make Uint8ClampedArray use TypedArray
Instead of being its own separate unrelated class. This automatically makes typed array properties available to it, as well as making it available to the runtime.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
ba5da79617
commit
6af596d9e8
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibJS/Runtime/Uint8ClampedArray.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibWeb/HTML/ImageData.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
@@ -26,7 +26,7 @@ RefPtr<ImageData> ImageData::create_with_size(JS::GlobalObject& global_object, i
|
||||
|
||||
auto data_handle = JS::make_handle(data);
|
||||
|
||||
auto bitmap = Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(width, height), 1, width * sizeof(u32), (u32*)data->data());
|
||||
auto bitmap = Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::RGBA8888, Gfx::IntSize(width, height), 1, width * sizeof(u32), data->data().data());
|
||||
if (!bitmap)
|
||||
return nullptr;
|
||||
return adopt_ref(*new ImageData(bitmap.release_nonnull(), move(data_handle)));
|
||||
|
||||
Reference in New Issue
Block a user