Skip to content

Commit de62d9c

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "boot animation is dithered and scaled" into ics-mr1
2 parents a3cc20f + 2b99e55 commit de62d9c

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)