-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Do not render elements in empty masks #7895
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
Conversation
@GoodBoyDigital what do you think about MaskHandler? Maybe add a runner like that somewhere? Im sure we need third param because that shows that |
Looks like how breaking change, because it change a Container default render implementation (public API), and has side effects for libs and codebase that use custom container implementation. Can you guarantee that fix will working and witout checking If not, i not think that this is full solution. Logicaly a dropping subtree when mask is empty not should be a main solutions for 'flipped bechavior', only as optimization of redundant operation. Then there are a some projects that depends of 'render' call, which you kill in so specific case that cannot be tracked outside easily. then, using a state of mask data inside 'render' logic increase a coupling bethween modules, and increase fail results for each masked objects by invalid results of 'pushMask' (in another case we can see a bugged render results, in this we can hang a doRender = false and nothing will rendered at all) |
Old implementations of Yes, this is basically However, I see the problem with my idea - textures in that subtree wont be touched and might be removed by texture GC after 3 minutes or so of being in such mask. |
@ivanpopelyshev - thanks for the quick fix! The issue is fixed in our codebase, but it causes some issues with nested masks. I'll put a reproduction case together. |
yes, maybe i can make this PR with different mode: "stencil instead of empty scissor" implementation. Like, if mask is scissor and its empty, do stencil instead. |
@ivanpopelyshev - here's a quick test I made: https://www.pixiplayground.com/#/edit/7biTBgB4JJLB25b7epBoG it should look like this: (red and blue areas are sprites inside masked containers) |
OK, agree, i'll just make easier separate PR tomorrow |
Closed in favor of #7896 |
V6 fix for #7855
This is more permanent solution: API allows to remove whole subtree from render. Scissor handler calculates whether intersection of scissor rect and screen is 0, in that case it doesnt bother scissor at all, evading w=0,h=0 bug on iOS and ANGLE with integrated video.
There will be new tests for this.
Bugged: https://www.pixiplayground.com/#/edit/2qJVNoyRHDVPMtaTJ4hCY
Fixed: https://www.pixiplayground.com/#/edit/NXMa4bNf_v9iVfX0IxNKb
Can be tested on iOS15 or any integrated videocard with ANGLE