Skip to content

Commit f743bed

Browse files
javachefacebook-github-bot
authored andcommitted
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
1 parent cfb11ca commit f743bed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ public CloseableReference<Bitmap> process(Bitmap source, PlatformBitmapFactory b
138138

139139
// We can't specify rounding in XML, so have to do so here
140140
private static GenericDraweeHierarchy buildHierarchy(Context context) {
141+
RoundingParams roundingParams = RoundingParams.fromCornersRadius(0);
142+
roundingParams.setPaintFilterBitmap(true);
141143
return new GenericDraweeHierarchyBuilder(context.getResources())
142-
.setRoundingParams(RoundingParams.fromCornersRadius(0))
144+
.setRoundingParams(roundingParams)
143145
.build();
144146
}
145147

0 commit comments

Comments
 (0)