diff options
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index b2474f2..1d4de22 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -23,6 +23,7 @@ #include <fcntl.h> #include <utils/misc.h> #include <signal.h> +#include <time.h> #include <cutils/properties.h> @@ -41,9 +42,13 @@ #include <gui/Surface.h> #include <gui/SurfaceComposerClient.h> +// TODO: Fix Skia. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include <SkBitmap.h> #include <SkStream.h> #include <SkImageDecoder.h> +#pragma GCC diagnostic pop #include <GLES/gl.h> #include <GLES/glext.h> @@ -57,10 +62,6 @@ #define SYSTEM_ENCRYPTED_BOOTANIMATION_FILE "/system/media/bootanimation-encrypted.zip" #define EXIT_PROP_NAME "service.bootanim.exit" -extern "C" int clock_nanosleep(clockid_t clock_id, int flags, - const struct timespec *request, - struct timespec *remain); - namespace android { static const int ANIM_ENTRY_NAME_MAX = 256; @@ -108,7 +109,7 @@ void BootAnimation::binderDied(const wp<IBinder>&) status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets, const char* name) { Asset* asset = assets.open(name, Asset::ACCESS_BUFFER); - if (!asset) + if (asset == NULL) return NO_INIT; SkBitmap bitmap; SkImageDecoder::DecodeMemory(asset->getBuffer(false), asset->getLength(), @@ -167,7 +168,7 @@ status_t BootAnimation::initTexture(const Animation::Frame& frame) SkBitmap bitmap; SkMemoryStream stream(frame.map->getDataPtr(), frame.map->getDataLength()); SkImageDecoder* codec = SkImageDecoder::Factory(&stream); - if (codec) { + if (codec != NULL) { codec->setDitherImage(false); codec->decode(&stream, &bitmap, kN32_SkColorType, @@ -255,7 +256,7 @@ status_t BootAnimation::readyToRun() { EGL_DEPTH_SIZE, 0, EGL_NONE }; - EGLint w, h, dummy; + EGLint w, h; EGLint numConfigs; EGLConfig config; EGLSurface surface; @@ -473,7 +474,7 @@ bool BootAnimation::movie() // Parse the description file for (;;) { const char* endl = strstr(s, "\n"); - if (!endl) break; + if (endl == NULL) break; String8 line(s, endl - s); const char* l = line.string(); int fps, width, height, count, pause; @@ -575,7 +576,6 @@ bool BootAnimation::movie() const int xc = (mWidth - animation.width) / 2; const int yc = ((mHeight - animation.height) / 2); - nsecs_t lastFrame = systemTime(); nsecs_t frameDuration = s2ns(1) / animation.fps; Region clearReg(Rect(mWidth, mHeight)); @@ -623,9 +623,9 @@ bool BootAnimation::movie() Region::const_iterator tail(clearReg.end()); glEnable(GL_SCISSOR_TEST); while (head != tail) { - const Rect& r(*head++); - glScissor(r.left, mHeight - r.bottom, - r.width(), r.height()); + const Rect& r2(*head++); + glScissor(r2.left, mHeight - r2.bottom, + r2.width(), r2.height()); glClear(GL_COLOR_BUFFER_BIT); } glDisable(GL_SCISSOR_TEST); |