Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android clipPath equivalent for hardware accelerated View

Tags:

android

The only part of my app that is still software rendered is the rendering of one view where I need to draw a round bitmap. I'm using clipPath to clip the bitmap that I need to render to the round shape.

I understand that clipPath is not hardware accelerated, but I am looking for an algorithm that would allow me to provide the equivalent functionality using hardware acceleration.

Specifically I need to create a round clipping region of a source bitmap and have that rendered to my canvas.

like image 880
Lee Avatar asked Aug 15 '12 16:08

Lee


1 Answers

If you have to use clipPath you could shut down the hardware acceleration as below.

<application
    android:label="@string/application_name"
    android:hardwareAccelerated="false">

And you also could control hardware acceleration among Application, Activity, Window and View layers. Detail information describes on this Hardware Acceleration article on Android Development web site.

like image 96
SFeng Avatar answered Oct 02 '22 18:10

SFeng