blob: 42e9eed7d3eb5079e2bed14387cf0170d23a16d6 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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 <EGL/egl.h>
30#include <GLES/gl.h>
31
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032class SkBitmap;
33
34namespace android {
35
36class AssetManager;
37class EGLNativeWindowSurface;
38
39// ---------------------------------------------------------------------------
40
41class BootAnimation : public Thread
42{
43public:
Mathias Agopian627e7b52009-05-21 19:21:59 -070044 BootAnimation();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045 virtual ~BootAnimation();
46
47 const sp<SurfaceComposerClient>& session() const;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048
49private:
50 virtual bool threadLoop();
51 virtual status_t readyToRun();
52 virtual void onFirstRef();
53
54 struct Texture {
55 GLint w;
56 GLint h;
57 GLuint name;
58 };
59
60 status_t initTexture(Texture* texture, AssetManager& asset, const char* name);
61 bool android();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062
63 sp<SurfaceComposerClient> mSession;
64 AssetManager mAssets;
Mathias Agopianb24b2972009-03-24 18:34:22 -070065 Texture mAndroid[2];
66 int mWidth;
67 int mHeight;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 EGLDisplay mDisplay;
69 EGLDisplay mContext;
70 EGLDisplay mSurface;
71 sp<Surface> mFlingerSurface;
72 sp<EGLNativeWindowSurface> mNativeWindowSurface;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073};
74
75// ---------------------------------------------------------------------------
76
77}; // namespace android
78
79#endif // ANDROID_BOOTANIMATION_H