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 8eaee55 commit 46d93a84d5e561d64ff0e20df2f7ab8c5d89bbcf @tpruvot tpruvot committed with Whitehawkx Jul 20, 2012
Showing with 8 additions and 0 deletions.
  1. +4 −0 cmds/bootanimation/Android.mk
  2. +4 −0 cmds/bootanimation/BootAnimation.cpp
@@ -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
@@ -161,7 +161,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 46d93a8

Please sign in to comment.