Skip to content

Commit 2b99e55

Browse files
committed
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
1 parent 785fd36 commit 2b99e55

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cmds/bootanimation/BootAnimation.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <surfaceflinger/ISurfaceComposerClient.h>
4343

4444
#include <core/SkBitmap.h>
45+
#include <core/SkStream.h>
4546
#include <images/SkImageDecoder.h>
4647

4748
#include <GLES/gl.h>
@@ -150,9 +151,15 @@ status_t BootAnimation::initTexture(void* buffer, size_t len)
150151
//StopWatch watch("blah");
151152

152153
SkBitmap bitmap;
153-
SkImageDecoder::DecodeMemory(buffer, len,
154-
&bitmap, SkBitmap::kRGB_565_Config,
155-
SkImageDecoder::kDecodePixels_Mode);
154+
SkMemoryStream stream(buffer, len);
155+
SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
156+
codec->setDitherImage(false);
157+
if (codec) {
158+
codec->decode(&stream, &bitmap,
159+
SkBitmap::kRGB_565_Config,
160+
SkImageDecoder::kDecodePixels_Mode);
161+
delete codec;
162+
}
156163

157164
// ensure we can call getPixels(). No need to call unlock, since the
158165
// bitmap will go out of scope when we return from this method.

0 commit comments

Comments
 (0)