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_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 | |
| 33 | class LayerOrientationAnim : public LayerBase |
| 34 | { |
| 35 | public: |
| 36 | static const uint32_t typeInfo; |
| 37 | static const char* const typeID; |
| 38 | virtual char const* getTypeID() const { return typeID; } |
| 39 | virtual uint32_t getTypeInfo() const { return typeInfo; } |
| 40 | |
| 41 | LayerOrientationAnim(SurfaceFlinger* flinger, DisplayID display, |
| 42 | OrientationAnimation* anim, |
| 43 | const LayerBitmap& zoomOut, |
| 44 | const LayerBitmap& zoomIn); |
| 45 | virtual ~LayerOrientationAnim(); |
| 46 | |
| 47 | void onOrientationCompleted(); |
| 48 | |
| 49 | virtual void onDraw(const Region& clip) const; |
| 50 | virtual Point getPhysicalSize() const; |
| 51 | virtual void validateVisibility(const Transform& globalTransform); |
| 52 | virtual bool needsBlending() const; |
| 53 | virtual bool isSecure() const { return false; } |
| 54 | private: |
| 55 | void drawScaled(float scale, float alpha) const; |
| 56 | |
| 57 | OrientationAnimation* mAnim; |
| 58 | LayerBitmap mBitmap; |
| 59 | LayerBitmap mBitmapIn; |
| 60 | nsecs_t mStartTime; |
| 61 | nsecs_t mFinishTime; |
| 62 | bool mOrientationCompleted; |
| 63 | mutable bool mFirstRedraw; |
| 64 | mutable float mLastNormalizedTime; |
| 65 | mutable float mLastScale; |
| 66 | mutable GLuint mTextureName; |
| 67 | mutable GLuint mTextureNameIn; |
| 68 | mutable bool mNeedsBlending; |
| 69 | }; |
| 70 | |
| 71 | // --------------------------------------------------------------------------- |
| 72 | |
| 73 | }; // namespace android |
| 74 | |
| 75 | #endif // ANDROID_LAYER_ORIENTATION_ANIM_H |