Android Copybit简介

本文介绍了Android HAL中的Copybit模块,该模块作为基本2D blitter的抽象层,支持旋转、缩放及颜色/像素格式转换等功能。在某些设备上,如G1手机,Copybit被用于所有窗口合成和视频播放,提供快速的上下缩放效果。文章还讨论了从Donut版本开始,Copybit模块使用方式的变化,以及其与OpenGLES API的关系。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自:http://blog.youkuaiyun.com/BonderWu/archive/2010/08/11/5805584.aspx

 

以前做Camera时为了解决VideoCamera取景时,在高分辨率下数码变焦花屏的问题,找到的关于Copybit的资料,目前还没找到出处。对Copybit没有过多的研究,先贴到这儿,以后有时间好好研究一下。

Android HAL consists of several hardware accelerated modules, and copybit is one of them implemented in G1 phone.

While OpenGL ES cannot be used or it's in software implementation, copybit is used.  Actually in cupcake branch, SurfaceFlinger always uses copybit instead of GL if copybit is available -- but that's an oversight.

[[ Functions ]] 
copybit is just an abstraction for a basic 2D blitter with support for rotation, scaling and color/pixelformat conversions. These features can be supported in full or partially.

If the copybit module is present, then SurfaceFlinger will try to use it instead of using OpenGL ES.

On the G1 copybit is used for all window compositions and video playback (CC and scaling), on this h/w copybit is very fast and provide very good up and down scaling.

[[ Donut Changes ]] 
HOWEVER, on the release after Donut, the copybit module won't be used by SurfaceFlinger directly, instead it will be used as a back-end for our software OpenGL ES 1.x and SurfaceFlinger will only use the OpenGL ES API.  Eventually, the copybit module will be phased out, instead, we will ask the ISV/OEMs to implement these features on their OpenGL ES drivers, if they think it is necessary.

[[ Usability ]] 
If your h/w doesn't have accelerated GL, but has some sort of decent 2D blitter, you can write a copybit HAL module for it, and it will be used automatically by SurfaceFlinger -- at least under cupcake and donut.

[[ Limitations ]] 
There are no mechanism to accelerate applications at the moment.  Skia is a purely software renderer. It can greatly benefit from newer CPUs though, which have SIMD instructions, often, it'll be able to operate at bus speed in that case. We're working on optimization in that area.

If a device has a GPU, it makes no sense to implement copybit, because

(1) it won't be used by apps and

(2) SurfaceFlinger already uses the GPU for its work.

Now, if the device has an additional 2D part (like the G1), it is useful to implement copybit, this way application won't have to share the GPU with SurfaceFlinger

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值