The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 32 | #include "Barrier.h" |
| 33 | |
| 34 | class SkBitmap; |
| 35 | |
| 36 | namespace android { |
| 37 | |
| 38 | class AssetManager; |
| 39 | class EGLNativeWindowSurface; |
| 40 | |
| 41 | // --------------------------------------------------------------------------- |
| 42 | |
| 43 | class BootAnimation : public Thread |
| 44 | { |
| 45 | public: |
| 46 | BootAnimation(const sp<ISurfaceComposer>& composer); |
| 47 | virtual ~BootAnimation(); |
| 48 | |
| 49 | const sp<SurfaceComposerClient>& session() const; |
| 50 | virtual void requestExit(); |
| 51 | |
| 52 | private: |
| 53 | virtual bool threadLoop(); |
| 54 | virtual status_t readyToRun(); |
| 55 | virtual void onFirstRef(); |
| 56 | |
| 57 | struct Texture { |
| 58 | GLint w; |
| 59 | GLint h; |
| 60 | GLuint name; |
| 61 | }; |
| 62 | |
| 63 | status_t initTexture(Texture* texture, AssetManager& asset, const char* name); |
| 64 | bool android(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | |
| 66 | sp<SurfaceComposerClient> mSession; |
| 67 | AssetManager mAssets; |
Mathias Agopian | 7a7af5c | 2009-03-24 18:34:16 -0700 | [diff] [blame] | 68 | Texture mAndroid[2]; |
| 69 | int mWidth; |
| 70 | int mHeight; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 71 | EGLDisplay mDisplay; |
| 72 | EGLDisplay mContext; |
| 73 | EGLDisplay mSurface; |
| 74 | sp<Surface> mFlingerSurface; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | Barrier mBarrier; |
| 76 | }; |
| 77 | |
| 78 | // --------------------------------------------------------------------------- |
| 79 | |
| 80 | }; // namespace android |
| 81 | |
| 82 | #endif // ANDROID_BOOTANIMATION_H |