summaryrefslogtreecommitdiffstats
path: root/cmds/bootanimation
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-10 15:59:07 -0800
committerMathias Agopian <mathias@google.com>2011-11-10 15:59:07 -0800
commit2b99e55ee3a0956a43a276f8018356ff9d08eafc (patch)
tree6f6dd68ef11de2ecc5eeed67d478fcad1a65d4d2 /cmds/bootanimation
parent785fd3685a69e5b3ef9c0958dcf4ae85f818e78d (diff)
downloadframeworks_base-2b99e55ee3a0956a43a276f8018356ff9d08eafc.zip
frameworks_base-2b99e55ee3a0956a43a276f8018356ff9d08eafc.tar.gz
frameworks_base-2b99e55ee3a0956a43a276f8018356ff9d08eafc.tar.bz2
boot animation is dithered and scaled
disable dithering which shouldn't have been enabled in the first place because the frames are typically scaled. we still use a 16-bits texture format to preserve memory. Bug: 5600948 Change-Id: Ib4d6e133df4375d0d735cd4325b6e589bbc5dafe
Diffstat (limited to 'cmds/bootanimation')
-rw-r--r--cmds/bootanimation/BootAnimation.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index d816e7c..154dbb8 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -42,6 +42,7 @@
#include <surfaceflinger/ISurfaceComposerClient.h>
#include <core/SkBitmap.h>
+#include <core/SkStream.h>
#include <images/SkImageDecoder.h>
#include <GLES/gl.h>
@@ -150,9 +151,15 @@ status_t BootAnimation::initTexture(void* buffer, size_t len)
//StopWatch watch("blah");
SkBitmap bitmap;
- SkImageDecoder::DecodeMemory(buffer, len,
- &bitmap, SkBitmap::kRGB_565_Config,
- SkImageDecoder::kDecodePixels_Mode);
+ SkMemoryStream stream(buffer, len);
+ SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
+ codec->setDitherImage(false);
+ if (codec) {
+ codec->decode(&stream, &bitmap,
+ SkBitmap::kRGB_565_Config,
+ SkImageDecoder::kDecodePixels_Mode);
+ delete codec;
+ }
// ensure we can call getPixels(). No need to call unlock, since the
// bitmap will go out of scope when we return from this method.