mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Enable paintFilterBitmap when rendering images with rounded corners
Summary: Per Android docs (https://developer.android.com/reference/android/graphics/Paint#FILTER_BITMAP_FLAG): > This should generally be on when drawing bitmaps, unless performance-bound (rendering to software canvas) or preferring pixelation artifacts to blurriness when scaling significantly. Changelog: [Android][Fixed] - Improve rendering of images when resampled and corner radius applied Reviewed By: genkikondo Differential Revision: D34551184 fbshipit-source-id: 649da53af816be829e5b7f8e2a100f07a8b412b7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cfb11ca2f6
commit
f743bed657
@@ -138,8 +138,10 @@ public class ReactImageView extends GenericDraweeView {
|
||||
|
||||
// We can't specify rounding in XML, so have to do so here
|
||||
private static GenericDraweeHierarchy buildHierarchy(Context context) {
|
||||
RoundingParams roundingParams = RoundingParams.fromCornersRadius(0);
|
||||
roundingParams.setPaintFilterBitmap(true);
|
||||
return new GenericDraweeHierarchyBuilder(context.getResources())
|
||||
.setRoundingParams(RoundingParams.fromCornersRadius(0))
|
||||
.setRoundingParams(roundingParams)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user