blob: 5fbbd428d6716a1442dd71d95708b7091b18c79d [file] [log] [blame]
Mathias Agopian89a18722009-03-27 15:36:09 -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_LAYER_ORIENTATION_ANIM_ROTATE_H
18#define ANDROID_LAYER_ORIENTATION_ANIM_ROTATE_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
28namespace android {
29
30// ---------------------------------------------------------------------------
31class OrientationAnimation;
32
33class LayerOrientationAnimRotate : public LayerOrientationAnimBase
34{
35public:
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 LayerOrientationAnimRotate(SurfaceFlinger* flinger, DisplayID display,
42 OrientationAnimation* anim,
43 const LayerBitmap& zoomOut,
44 const LayerBitmap& zoomIn);
45 virtual ~LayerOrientationAnimRotate();
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; }
54private:
55 void drawScaled(float angle, 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;
Mathias Agopiancb93c5a2009-03-27 16:13:24 -070063 int mOriginalTargetOrientation;
Mathias Agopian89a18722009-03-27 15:36:09 -070064 mutable bool mFirstRedraw;
65 mutable float mLastNormalizedTime;
66 mutable float mLastAngle;
67 mutable float mLastScale;
68 mutable GLuint mTextureName;
69 mutable GLuint mTextureNameIn;
70 mutable bool mNeedsBlending;
71};
72
73// ---------------------------------------------------------------------------
74
75}; // namespace android
76
77#endif // ANDROID_LAYER_ORIENTATION_ANIM_ROTATE_H