diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-05-22 23:33:26 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-05-26 15:34:13 +0430 |
commit | 6af596d9e8a0dfd9c175b7e56b848b969af191ae (patch) | |
tree | 29e9219a90b9107d1ed21f1c00713dd0e0a423e0 /Userland/Libraries/LibWeb/HTML/ImageData.cpp | |
parent | ba5da79617fed8f059bde2b4adb263e87f73c7e6 (diff) | |
download | serenity-6af596d9e8a0dfd9c175b7e56b848b969af191ae.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/ImageData.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/ImageData.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.cpp b/Userland/Libraries/LibWeb/HTML/ImageData.cpp index b44bb247a2..e9044829ed 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Userland/Libraries/LibWeb/HTML/ImageData.cpp @@ -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))); |