Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Never ever touch the Lua blitter #1268

Merged
merged 17 commits into from
Dec 24, 2020

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Dec 23, 2020

As a side-effect of #1200, software nightmode was no-longer handled in the C blitter, it instead went through to the Lua blitter.

This exacerbated the latent issues with LuaJIT and mcode_alloc on that platform (remember, the C blitter was initially implemented specifically to avoid stressing LuaJIT with the blitter code on Android because of that fact).

So, without going back to the admittedly messy way this was handled before, tweak a few things to make Android a special snowflake again, so that nightmode on Android no longer goes through the Lua blitter.

In fact, port paintRoundedRect to the C blitter to make doubly sure of that (and get rid of an ugly hack that was necessary to handle inversion quirks in setPixel otherwise ;p).


This change is Reviewable

@NiLuJe
Copy link
Member Author

NiLuJe commented Dec 23, 2020

Fun fact: remember the days when the one (nearly) sure-fire way we could reproduce the same kind of weird JIT hiccups on Kobo @ 16bpp back in the day, @poire-z?

That was with AlphaContainer & MovableContainer... And what do they have to do with this? They're the main source of paintRoundedRect calls... :o)

@NiLuJe NiLuJe merged commit be40ecc into koreader:master Dec 24, 2020
NiLuJe added a commit to koreader/koreader that referenced this pull request Dec 24, 2020
roygbyte pushed a commit to roygbyte/koreader-base that referenced this pull request Mar 3, 2022
* Go through the C BB for nightmode on Android, to avoid performance issues in the Lua blitter because of the mcode alloc restrictions on that platform.

(Re koreader#1200)

* Port paintRoundedCorner to the C blitter to avoid the setPixel invert/cbb/android exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant