RazrFalcon / tiny-skia

A tiny Skia subset ported to Rust
BSD 3-Clause "New" or "Revised" License
1.12k stars 69 forks source link

Access to clip mask content #21

Closed sandmor closed 3 years ago

sandmor commented 3 years ago

I need to combine two clip mask, to do this I only need to execute map(|a, b| a | b) on every byte that makes up the mask, would be possible to implement byte level access to ClipMask or another mechanism to achieve this?. Notice that two mask that I'm trying to combine has equal dimensions so that operation is totally valid even for a flat byte array

RazrFalcon commented 3 years ago

It's not possible right now and your implementation is flawed, because you're forgetting about anti-aliasing.

To illustrate the problem, ClipMask implementation in Skia is like 5000 LOC, while in skia it's just 300. There are tons of work and I don't have much time right now.

RazrFalcon commented 3 years ago

22

sandmor commented 3 years ago

Thank you. Sorry for the duplicating I forget to look if there was another issue about this

RazrFalcon commented 3 years ago

Don't worry. I've just created it.