vinc3m1 / RoundedImageView

A fast ImageView that supports rounded corners, ovals, and circles.
Other
6.44k stars 1.25k forks source link

Supported Multiple nonzero corner radii. #236

Closed xxjy closed 1 year ago

vinc3m1 commented 5 years ago

Nice, though I wonder if the hardware acceleration support for path is different from drawRoundRect?

https://developer.android.com/guide/topics/graphics/hardware-accel#scaling

Would be nice to clearly understand the limitations first. Or another option is to only use the path API when different radii are specified?

xxjy commented 5 years ago

The project may not involve Canvas scaling, I tested it properly on device API16.

In addition, I found the drawPath in GradientDrawable to achieve rounded corners.

http://androidxref.com/2.2.3/xref/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java#310

I can modify the code if it is necessary to only use the path API when different radii are specified.