Permalink
Browse files

bootanimation: allow using RGB565 instead of ARGB8888

RGB565 uses considerably less memory, and together with texture
cache, it allows us to offer a really smooth bootanimation on
not so powerful devices.

Change-Id: I9da8fd7e6a587b5895519dd0983ec9b8f676771b
  • Loading branch information...
1 parent b9b5d8c commit 9b77c68dc778ac0586cabff695a542df0bebb8e2 @tpruvot tpruvot committed with xoomdev Jul 20, 2012
Showing with 8 additions and 0 deletions.
  1. +4 −0 cmds/bootanimation/Android.mk
  2. +4 −0 cmds/bootanimation/BootAnimation.cpp
View
4 cmds/bootanimation/Android.mk
@@ -33,6 +33,10 @@ ifeq ($(TARGET_BOOTANIMATION_TEXTURE_CACHE),false)
LOCAL_CFLAGS += -DNO_TEXTURE_CACHE=1
endif
+ifeq ($(TARGET_BOOTANIMATION_USE_RGB565),true)
+ LOCAL_CFLAGS += -DUSE_565
+endif
+
LOCAL_MODULE:= bootanimation
View
4 cmds/bootanimation/BootAnimation.cpp
@@ -162,7 +162,11 @@ status_t BootAnimation::initTexture(void* buffer, size_t len)
codec->setDitherImage(false);
if (codec) {
codec->decode(&stream, &bitmap,
+ #ifdef USE_565
+ SkBitmap::kRGB_565_Config,
+ #else
SkBitmap::kARGB_8888_Config,
+ #endif
SkImageDecoder::kDecodePixels_Mode);
delete codec;
}

0 comments on commit 9b77c68

Please sign in to comment.