blob: a4a6d49ded7a2fdadfc43cbc47dade15b5ed92e7 [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_BOOTANIMATION_H
18#define ANDROID_BOOTANIMATION_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/threads.h>
24#include <utils/AssetManager.h>
25
26#include <ui/ISurfaceComposer.h>
27#include <ui/SurfaceComposerClient.h>
28
29#include <GLES/egl.h>
30
31#include "Barrier.h"
32
33class SkBitmap;
34
35namespace android {
36
37class AssetManager;
38
39// ---------------------------------------------------------------------------
40
41class BootAnimation : public Thread
42{
43public:
44 BootAnimation(const sp<ISurfaceComposer>& composer);
45 virtual ~BootAnimation();
46
47 const sp<SurfaceComposerClient>& session() const;
48 virtual void requestExit();
49
50private:
51 virtual bool threadLoop();
52 virtual status_t readyToRun();
53 virtual void onFirstRef();
54
55 struct Texture {
56 GLint w;
57 GLint h;
58 GLuint name;
59 };
60
61 status_t initTexture(Texture* texture, AssetManager& asset, const char* name);
62 bool android();
63 bool cylon();
64
65 sp<SurfaceComposerClient> mSession;
66 AssetManager mAssets;
67 Texture mLeftTrail;
68 Texture mRightTrail;
69 Texture mBrightSpot;
70 Texture mAndroid[3];
71 int mWidth;
72 int mHeight;
73 EGLDisplay mDisplay;
74 EGLDisplay mContext;
75 EGLDisplay mSurface;
76 sp<Surface> mFlingerSurface;
77 Barrier mBarrier;
78};
79
80// ---------------------------------------------------------------------------
81
82}; // namespace android
83
84#endif // ANDROID_BOOTANIMATION_H