mlepage
mlepage

Reputation: 2472

Android, Skia, and hardware accelerated graphics

This page http://source.android.com/devices/graphics.html says:

Prior to Android 3.0, Canvas used the Skia 2D drawing library to draw, which could not take advantage of hardware acceleration. Introduced in Android 3.0, hardware acceleration for Canvas APIs uses a new drawing library called OpenGLRenderer that translates Canvas operations to OpenGL operations so that they can execute on the GPU.

However, the Skia page http://code.google.com/p/skia/ says Skia can back end onto OpenGL.

Further, this Skia FAQ https://sites.google.com/site/skiadocs/user-documentation/faq says: "SkGLCanvas has been written to direct its drawing calls to OpenGL."

So I am wondering, is there a particular reason Android doesn't simply use Skia backing onto OpenGL to obtain hardware accelerated graphics? (Maybe a distinction between OpenGL and OpenGL ES?)

Upvotes: 3

Views: 11815

Answers (3)

Duke79
Duke79

Reputation: 927

Apparently, things are changing (again) with Android-O. (also discussed here)

Skia in Android-O

Upvotes: 2

yoneal
yoneal

Reputation: 323

According to this: Hardware Accelerated 2D Rendering for Android (slides 36 - 39)

Android uses a Display List to efficiently draw views, that's why it can't use the OpenGL backend of Skia directly.

Upvotes: 1

ClayMontgomery
ClayMontgomery

Reputation: 2832

They clearly intended for Skia to be accelerated by something, but it never actually happened. PixelFlinger and libagl also look a lot like an early version of OpenGL, but were never actually accelerated either.

The big disruption was the 2.0 version of OpenGL ES. Most of its power lies in its shading language and there was no straightforward way to exploit that through Skia. ICS was really a major re-design where they abandoned Skia to use OpenGL ES 2.0 instead - with all it's GLSL capabilities.

They also badly needed the improved support for FBOs in 2.0. It is the basis of the new TextureView and VideoView classes.

It's also important that over 99% of all Android devices now have OpenGL ES 2.0 acceleration. For an example of how they exposed GLSL to the Canvas API in ICS, take a look at the Effects class.

Upvotes: 3

Related Questions