2009-03-03 19:31:44 -08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ANDROID_BOOTANIMATION_H
|
|
|
|
#define ANDROID_BOOTANIMATION_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2012-02-17 18:27:36 -08:00
|
|
|
#include <androidfw/AssetManager.h>
|
2009-03-03 19:31:44 -08:00
|
|
|
#include <utils/threads.h>
|
|
|
|
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
#include <GLES/gl.h>
|
|
|
|
|
|
|
|
class SkBitmap;
|
|
|
|
|
|
|
|
namespace android {
|
|
|
|
|
2012-02-25 18:48:35 -08:00
|
|
|
class Surface;
|
|
|
|
class SurfaceComposerClient;
|
|
|
|
class SurfaceControl;
|
2009-03-03 19:31:44 -08:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
2009-09-23 15:44:05 -07:00
|
|
|
class BootAnimation : public Thread, public IBinder::DeathRecipient
|
2009-03-03 19:31:44 -08:00
|
|
|
{
|
|
|
|
public:
|
2009-05-21 19:21:59 -07:00
|
|
|
BootAnimation();
|
2009-03-03 19:31:44 -08:00
|
|
|
virtual ~BootAnimation();
|
|
|
|
|
2009-09-23 15:44:05 -07:00
|
|
|
sp<SurfaceComposerClient> session() const;
|
2009-03-03 19:31:44 -08:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual bool threadLoop();
|
|
|
|
virtual status_t readyToRun();
|
|
|
|
virtual void onFirstRef();
|
2009-09-23 15:44:05 -07:00
|
|
|
virtual void binderDied(const wp<IBinder>& who);
|
2009-03-03 19:31:44 -08:00
|
|
|
|
|
|
|
struct Texture {
|
|
|
|
GLint w;
|
|
|
|
GLint h;
|
|
|
|
GLuint name;
|
|
|
|
};
|
|
|
|
|
2009-10-01 03:10:14 -07:00
|
|
|
struct Animation {
|
|
|
|
struct Frame {
|
|
|
|
String8 name;
|
|
|
|
FileMap* map;
|
|
|
|
mutable GLuint tid;
|
|
|
|
bool operator < (const Frame& rhs) const {
|
|
|
|
return name < rhs.name;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
struct Part {
|
|
|
|
int count;
|
|
|
|
int pause;
|
|
|
|
String8 path;
|
|
|
|
SortedVector<Frame> frames;
|
2012-04-26 10:38:55 -07:00
|
|
|
bool playUntilComplete;
|
2009-10-01 03:10:14 -07:00
|
|
|
};
|
|
|
|
int fps;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
Vector<Part> parts;
|
|
|
|
};
|
|
|
|
|
2009-03-03 19:31:44 -08:00
|
|
|
status_t initTexture(Texture* texture, AssetManager& asset, const char* name);
|
2009-10-01 03:10:14 -07:00
|
|
|
status_t initTexture(void* buffer, size_t len);
|
2009-03-03 19:31:44 -08:00
|
|
|
bool android();
|
2009-10-01 03:10:14 -07:00
|
|
|
bool movie();
|
2009-03-03 19:31:44 -08:00
|
|
|
|
2012-04-26 10:38:55 -07:00
|
|
|
void checkExit();
|
|
|
|
|
2009-03-03 19:31:44 -08:00
|
|
|
sp<SurfaceComposerClient> mSession;
|
|
|
|
AssetManager mAssets;
|
2009-03-24 18:34:16 -07:00
|
|
|
Texture mAndroid[2];
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
2009-03-03 19:31:44 -08:00
|
|
|
EGLDisplay mDisplay;
|
|
|
|
EGLDisplay mContext;
|
|
|
|
EGLDisplay mSurface;
|
2009-04-16 20:04:08 -07:00
|
|
|
sp<SurfaceControl> mFlingerSurfaceControl;
|
2009-03-03 19:31:44 -08:00
|
|
|
sp<Surface> mFlingerSurface;
|
2009-10-01 03:10:14 -07:00
|
|
|
bool mAndroidAnimation;
|
|
|
|
ZipFileRO mZip;
|
2009-03-03 19:31:44 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
}; // namespace android
|
|
|
|
|
|
|
|
#endif // ANDROID_BOOTANIMATION_H
|