diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/extras/alpha_blend.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/extras/alpha_blend.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/extras/alpha_blend.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/third_party/jpeg-xl/lib/extras/alpha_blend.cc b/third_party/jpeg-xl/lib/extras/alpha_blend.cc index 50c141c6fb..afb37b0a7d 100644 --- a/third_party/jpeg-xl/lib/extras/alpha_blend.cc +++ b/third_party/jpeg-xl/lib/extras/alpha_blend.cc @@ -12,7 +12,7 @@ namespace extras { namespace { -void AlphaBlend(PackedFrame* frame, float background[3]) { +void AlphaBlend(PackedFrame* frame, const float background[3]) { if (!frame) return; const PackedImage& im = frame->color; JxlPixelFormat format = im.format; @@ -20,7 +20,8 @@ void AlphaBlend(PackedFrame* frame, float background[3]) { return; } --format.num_channels; - PackedImage blended(im.xsize, im.ysize, format); + JXL_ASSIGN_OR_DIE(PackedImage blended, + PackedImage::Create(im.xsize, im.ysize, format)); // TODO(szabadka) SIMDify this and make it work for float16. for (size_t y = 0; y < im.ysize; ++y) { for (size_t x = 0; x < im.xsize; ++x) { @@ -48,7 +49,7 @@ void AlphaBlend(PackedFrame* frame, float background[3]) { } // namespace -void AlphaBlend(PackedPixelFile* ppf, float background[3]) { +void AlphaBlend(PackedPixelFile* ppf, const float background[3]) { if (!ppf || ppf->info.alpha_bits == 0) { return; } |