The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 17 | #ifndef ANDROID_SF_LAYER_STATE_H |
| 18 | #define ANDROID_SF_LAYER_STATE_H |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <sys/types.h> |
| 22 | |
| 23 | #include <utils/Errors.h> |
| 24 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | #include <ui/Region.h> |
Jamie Gennis | f15a83f | 2012-05-10 20:43:55 -0700 | [diff] [blame^] | 26 | #include <ui/Rect.h> |
Mathias Agopian | 90ac799 | 2012-02-25 18:48:35 -0800 | [diff] [blame] | 27 | #include <gui/ISurface.h> |
Mathias Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 28 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | namespace android { |
| 30 | |
| 31 | class Parcel; |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 32 | class ISurfaceComposerClient; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | |
| 34 | struct layer_state_t { |
| 35 | |
| 36 | layer_state_t() |
| 37 | : surface(0), what(0), |
| 38 | x(0), y(0), z(0), w(0), h(0), |
| 39 | alpha(0), tint(0), flags(0), mask(0), |
| 40 | reserved(0) |
| 41 | { |
| 42 | matrix.dsdx = matrix.dtdy = 1.0f; |
| 43 | matrix.dsdy = matrix.dtdx = 0.0f; |
Jamie Gennis | f15a83f | 2012-05-10 20:43:55 -0700 | [diff] [blame^] | 44 | crop.makeInvalid(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | status_t write(Parcel& output) const; |
| 48 | status_t read(const Parcel& input); |
| 49 | |
| 50 | struct matrix22_t { |
| 51 | float dsdx; |
| 52 | float dtdx; |
| 53 | float dsdy; |
| 54 | float dtdy; |
| 55 | }; |
| 56 | SurfaceID surface; |
| 57 | uint32_t what; |
Mathias Agopian | 41b6aab | 2011-08-30 18:51:54 -0700 | [diff] [blame] | 58 | float x; |
| 59 | float y; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | uint32_t z; |
| 61 | uint32_t w; |
| 62 | uint32_t h; |
| 63 | float alpha; |
| 64 | uint32_t tint; |
| 65 | uint8_t flags; |
| 66 | uint8_t mask; |
| 67 | uint8_t reserved; |
| 68 | matrix22_t matrix; |
Jamie Gennis | f15a83f | 2012-05-10 20:43:55 -0700 | [diff] [blame^] | 69 | Rect crop; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | // non POD must be last. see write/read |
| 71 | Region transparentRegion; |
| 72 | }; |
| 73 | |
Mathias Agopian | 698c087 | 2011-06-28 19:09:31 -0700 | [diff] [blame] | 74 | struct ComposerState { |
| 75 | sp<ISurfaceComposerClient> client; |
| 76 | layer_state_t state; |
| 77 | status_t write(Parcel& output) const; |
| 78 | status_t read(const Parcel& input); |
| 79 | }; |
| 80 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 81 | }; // namespace android |
| 82 | |
Mathias Agopian | 9cce325 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 83 | #endif // ANDROID_SF_LAYER_STATE_H |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 84 | |