blob: ca277e02b94bb65fcf8a4c4df6d9bdd9af191d9e [file] [log] [blame]
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2008 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
Mathias Agopian3cf61352010-02-09 17:46:37 -080017#ifndef ANDROID_SF_LAYER_STATE_H
18#define ANDROID_SF_LAYER_STATE_H
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080019
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
24
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080025#include <ui/Region.h>
Mathias Agopiandf712ea2012-02-25 18:48:35 -080026#include <gui/ISurface.h>
Mathias Agopian3cf61352010-02-09 17:46:37 -080027
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080028namespace android {
29
30class Parcel;
Mathias Agopian2df788f2011-06-28 19:09:31 -070031class ISurfaceComposerClient;
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080032
33struct layer_state_t {
34
35 layer_state_t()
36 : surface(0), what(0),
37 x(0), y(0), z(0), w(0), h(0),
38 alpha(0), tint(0), flags(0), mask(0),
39 reserved(0)
40 {
41 matrix.dsdx = matrix.dtdy = 1.0f;
42 matrix.dsdy = matrix.dtdx = 0.0f;
43 }
44
45 status_t write(Parcel& output) const;
46 status_t read(const Parcel& input);
47
48 struct matrix22_t {
49 float dsdx;
50 float dtdx;
51 float dsdy;
52 float dtdy;
53 };
54 SurfaceID surface;
55 uint32_t what;
Mathias Agopian8343f2c2011-08-30 18:51:54 -070056 float x;
57 float y;
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080058 uint32_t z;
59 uint32_t w;
60 uint32_t h;
61 float alpha;
62 uint32_t tint;
63 uint8_t flags;
64 uint8_t mask;
65 uint8_t reserved;
66 matrix22_t matrix;
67 // non POD must be last. see write/read
68 Region transparentRegion;
69};
70
Mathias Agopian2df788f2011-06-28 19:09:31 -070071struct ComposerState {
72 sp<ISurfaceComposerClient> client;
73 layer_state_t state;
74 status_t write(Parcel& output) const;
75 status_t read(const Parcel& input);
76};
77
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080078}; // namespace android
79
Mathias Agopian3cf61352010-02-09 17:46:37 -080080#endif // ANDROID_SF_LAYER_STATE_H
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080081