blob: f1a2618c7efb4498ab3709bb0957baf8828ea66c [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
17#ifndef ANDROID_COMPOSER_LAYER_STATE_H
18#define ANDROID_COMPOSER_LAYER_STATE_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
24
25#include <ui/ISurfaceFlingerClient.h>
26#include <ui/Region.h>
27
The Android Open Source Project89fa4ad2009-03-03 19:31:44 -080028namespace android {
29
30class Parcel;
31
32struct layer_state_t {
33
34 layer_state_t()
35 : surface(0), what(0),
36 x(0), y(0), z(0), w(0), h(0),
37 alpha(0), tint(0), flags(0), mask(0),
38 reserved(0)
39 {
40 matrix.dsdx = matrix.dtdy = 1.0f;
41 matrix.dsdy = matrix.dtdx = 0.0f;
42 }
43
44 status_t write(Parcel& output) const;
45 status_t read(const Parcel& input);
46
47 struct matrix22_t {
48 float dsdx;
49 float dtdx;
50 float dsdy;
51 float dtdy;
52 };
53 SurfaceID surface;
54 uint32_t what;
55 int32_t x;
56 int32_t y;
57 uint32_t z;
58 uint32_t w;
59 uint32_t h;
60 float alpha;
61 uint32_t tint;
62 uint8_t flags;
63 uint8_t mask;
64 uint8_t reserved;
65 matrix22_t matrix;
66 // non POD must be last. see write/read
67 Region transparentRegion;
68};
69
70}; // namespace android
71
72#endif // ANDROID_COMPOSER_LAYER_STATE_H
73