blob: 12b6f1ceb8e0e06e9469f7a9369f0bf7f4653a58 [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_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
28namespace android {
29
30// ---------------------------------------------------------------------------
31class OrientationAnimation;
32
Mathias Agopian89a18722009-03-27 15:36:09 -070033
34class LayerOrientationAnimBase : public LayerBase
35{
36public:
37 LayerOrientationAnimBase(SurfaceFlinger* flinger, DisplayID display)
38 : LayerBase(flinger, display) {
39 }
40 virtual void onOrientationCompleted() = 0;
41};
42
43// ---------------------------------------------------------------------------
44
45class LayerOrientationAnim : public LayerOrientationAnimBase
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046{
47public:
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 Agopian89a18722009-03-27 15:36:09 -070055 const LayerBitmap& bitmapIn,
56 const LayerBitmap& bitmapOut);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057 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; }
66private:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067 OrientationAnimation* mAnim;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 LayerBitmap mBitmapIn;
Mathias Agopian89a18722009-03-27 15:36:09 -070069 LayerBitmap mBitmapOut;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 bool mOrientationCompleted;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080071 mutable GLuint mTextureName;
72 mutable GLuint mTextureNameIn;
73 mutable bool mNeedsBlending;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074};
75
76// ---------------------------------------------------------------------------
77
78}; // namespace android
79
80#endif // ANDROID_LAYER_ORIENTATION_ANIM_H