The Android Open Source Project | 9066cfe | 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_LAYER_ORIENTATION_ANIM_H |
| 18 | #define ANDROID_LAYER_ORIENTATION_ANIM_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <sys/types.h> |
| 22 | #include <utils/threads.h> |
| 23 | #include <utils/Parcel.h> |
| 24 | |
| 25 | #include "LayerBase.h" |
| 26 | #include "LayerBitmap.h" |
| 27 | |
| 28 | namespace android { |
| 29 | |
| 30 | // --------------------------------------------------------------------------- |
| 31 | class OrientationAnimation; |
| 32 | |
Mathias Agopian | 89a1872 | 2009-03-27 15:36:09 -0700 | [diff] [blame] | 33 | |
| 34 | class LayerOrientationAnimBase : public LayerBase |
| 35 | { |
| 36 | public: |
| 37 | LayerOrientationAnimBase(SurfaceFlinger* flinger, DisplayID display) |
| 38 | : LayerBase(flinger, display) { |
| 39 | } |
| 40 | virtual void onOrientationCompleted() = 0; |
| 41 | }; |
| 42 | |
| 43 | // --------------------------------------------------------------------------- |
| 44 | |
| 45 | class LayerOrientationAnim : public LayerOrientationAnimBase |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | { |
| 47 | public: |
| 48 | static const uint32_t typeInfo; |
| 49 | static const char* const typeID; |
| 50 | virtual char const* getTypeID() const { return typeID; } |
| 51 | virtual uint32_t getTypeInfo() const { return typeInfo; } |
| 52 | |
| 53 | LayerOrientationAnim(SurfaceFlinger* flinger, DisplayID display, |
| 54 | OrientationAnimation* anim, |
Mathias Agopian | 89a1872 | 2009-03-27 15:36:09 -0700 | [diff] [blame] | 55 | const LayerBitmap& bitmapIn, |
| 56 | const LayerBitmap& bitmapOut); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | virtual ~LayerOrientationAnim(); |
| 58 | |
| 59 | void onOrientationCompleted(); |
| 60 | |
| 61 | virtual void onDraw(const Region& clip) const; |
| 62 | virtual Point getPhysicalSize() const; |
| 63 | virtual void validateVisibility(const Transform& globalTransform); |
| 64 | virtual bool needsBlending() const; |
| 65 | virtual bool isSecure() const { return false; } |
| 66 | private: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 67 | OrientationAnimation* mAnim; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | LayerBitmap mBitmapIn; |
Mathias Agopian | 89a1872 | 2009-03-27 15:36:09 -0700 | [diff] [blame] | 69 | LayerBitmap mBitmapOut; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | bool mOrientationCompleted; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 71 | mutable GLuint mTextureName; |
| 72 | mutable GLuint mTextureNameIn; |
| 73 | mutable bool mNeedsBlending; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | // --------------------------------------------------------------------------- |
| 77 | |
| 78 | }; // namespace android |
| 79 | |
| 80 | #endif // ANDROID_LAYER_ORIENTATION_ANIM_H |