Skip to content

Fix black background on android#228

Merged
Naturalclar merged 1 commit intocallstack:masterfrom
alanjhughes:@alanhughes/fix-black-background
Nov 3, 2024
Merged

Fix black background on android#228
Naturalclar merged 1 commit intocallstack:masterfrom
alanjhughes:@alanhughes/fix-black-background

Conversation

@alanjhughes
Copy link
Contributor

@alanjhughes alanjhughes commented Sep 16, 2024

Overview

Closes #226
Calling setLayerType from setRenderingMode and passing null as the paint reference will cause the default paint to be used which will have it's PorterDuffXfermode set to SRC_OVER. This causes the incorrect result.

I've added a new mRenderingMode property that is used to call setLayerType from dispatchDraw where we have a paint reference with the correct PorterDuffXfermode set.

Test Plan

I've updated the example app to use 0.75 and tested both platforms on both architectures.

@samueljim
Copy link

LGTM

@samueljim
Copy link

I'm currently using this in my package.json for all those who need this fix

"@react-native-masked-view/masked-view": "https://github.com/react-native-masked-view/masked-view/archive/edee2e76a3ead5135d8328ec5c5073415e4c9dbe.tar.gz",

@samueljim
Copy link

BUMP

Copy link

@AliRezaBeigy AliRezaBeigy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @samueljim tested it's ok
i test it too and the black background issue goes away
@Naturalclar can you merge these change?

Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you so much!

@Naturalclar Naturalclar merged commit 0a05387 into callstack:master Nov 3, 2024
@alanjhughes alanjhughes deleted the @alanhughes/fix-black-background branch November 3, 2024 17:53
janicduplessis added a commit to rainbow-me/masked-view that referenced this pull request Jan 10, 2026
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.

Android broken background with react-native 0.75.1

5 participants