Fix ReactImageView.hasOverlappingRendering() (#45352)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45352

We claim that we will never draw multiple elements on top of each other, which isn't correct when we have a background.

We should claim that we can draw overlapping elements if we have a background drawable which we place in the Drawee hierarchy (part of the ImageView foreground drawable), or if the underlying view has a background drawable (which is handled by `ImageView` superclass `hasOverlappingRendering()`).

The effect of this is subtle, and just means that we get correct compositing when an opacity is set on image with background.

Changelog:
[Android][Fixed] - Fix ReactImageView.hasOverlappingRendering()

Reviewed By: mdvacca

Differential Revision: D59489788

fbshipit-source-id: fe2922f064b91f1709ed546dd647d4d4112d04c1
This commit is contained in:
Nick Gerleman
2024-07-09 14:59:40 -07:00
committed by Facebook GitHub Bot
parent 58c726a6ba
commit 2bed2ab1a6
@@ -567,10 +567,9 @@ public class ReactImageView extends GenericDraweeView {
}
}
/** ReactImageViews only render a single image. */
@Override
public boolean hasOverlappingRendering() {
return false;
return mBackgroundImageDrawable != null || super.hasOverlappingRendering();
}
private boolean hasMultipleSources() {