Skip to content

Commit

Permalink
remove no-op simd unmultiply
Browse files Browse the repository at this point in the history
Should've done this in tandem with this: https://github.com/rive-app/rive/pull/7820

Diffs=
87c967127 remove no-op simd unmultiply (#7836)

Co-authored-by: Luigi Rosso <[email protected]>
  • Loading branch information
luigi-rosso and luigi-rosso committed Aug 14, 2024
1 parent 8fef85d commit 86a5211
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4fb978a9230fc006b5e575364f062907e7dd2afe
87c9671271dadc0271156094058d74b01954aaf3
10 changes: 0 additions & 10 deletions Source/Renderer/RenderContextManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ @implementation RiveRendererContext
{
return nullptr;
}
// CG only supports premultiplied alpha. Unmultiply now.
size_t imageSizeInBytes = image.height * image.width * 4;
for (size_t i = 0; i < imageSizeInBytes; i += 4)
{
auto rgba = rive::simd::load<uint8_t, 4>(&image.pixels[i]);
if (rgba.a != 0)
{
rgba = rgba * 255 / rgba.a;
}
}
uint32_t mipLevelCount = rive::math::msb(image.height | image.width);
return makeImageTexture(image.width, image.height, mipLevelCount, image.pixels.data());
}
Expand Down

0 comments on commit 86a5211

Please sign in to comment.