DescriptionActually, these optimizations were done based on Android Eclair and Froyo branches. At that time, Android Framework were mainly using rgb565. Currently most are using 32b pixel format by default. However there are still some cases which are using 565 format (e.g. system UI on Android). Also, it's expected that these optimizations will also benefit other embedded platforms.
The benefit measurement I got on Android platform has several cases:
1. skia_bench -config 565 -forceBlend 1 -forceDither 1 -repeat 30
w/o these opts:
D/skia ( 1824): running bench [640 480] bitmap_8888
D/skia ( 1824): 565: cmsecs = 157.49
w/ these opts:
D/skia ( 1728): running bench [640 480] bitmap_8888
D/skia ( 1728): 565: cmsecs = 26.78
2. skia_bench -config 565 -repeat 30
w/o these opts:
D/skia ( 2954): running bench [640 480] bitmap_8888
D/skia ( 2954): 565: cmsecs = 27.39
D/skia ( 2954):
D/skia ( 2954): running bench [640 480] bitmap_8888_A
D/skia ( 2954): 565: cmsecs = 79.04
w/ these opts:
D/skia ( 2573): running bench [640 480] bitmap_8888
D/skia ( 2573): 565: cmsecs = 13.19
D/skia ( 2573):
D/skia ( 2573): running bench [640 480] bitmap_8888_A
D/skia ( 2573): 565: cmsecs = 27.41
3: skia_bench -config 565 -forceBlend 1 -repeat 30
w/o these opts:
D/skia ( 2216): running bench [640 480] bitmap_8888
D/skia ( 2216): 565: cmsecs = 115.36
D/skia ( 2216):
D/skia ( 2216): running bench [640 480] bitmap_8888_A
D/skia ( 2216): 565: cmsecs = 110.25
w/ these opts:
D/skia ( 2575): running bench [640 480] bitmap_8888
D/skia ( 2575): 565: cmsecs = 23.18
D/skia ( 2575):
D/skia ( 2575): running bench [640 480] bitmap_8888_A
D/skia ( 2575): 565: cmsecs = 38.36
4: skia_bench -config 565 -forceDither 1 -repeat 30
w/o these opts:
D/skia ( 1477): running bench [640 480] bitmap_8888
D/skia ( 1477): 565: cmsecs = 92.68
D/skia ( 1477):
D/skia ( 1477): running bench [640 480] bitmap_8888_A
D/skia ( 1477): 565: cmsecs = 88.33
w/ these opts:
D/skia ( 3315): running bench [640 480] bitmap_8888
D/skia ( 3315): 565: cmsecs = 16.25
D/skia ( 3315):
D/skia ( 3315): running bench [640 480] bitmap_8888_A
D/skia ( 3315): 565: cmsecs = 29.54
After running several times and double check between the results, it's stable.
Patch Set 1 #Patch Set 2 : include SkDither.h #Patch Set 3 : replaced __restrict__ with SK_RESTRICT and use intptr_t instead of int for casting pointers #
MessagesTotal messages: 14
|