2 // Copyright (c) 2016 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef PUBLIC_HWCDEFS_H_
18 #define PUBLIC_HWCDEFS_H_
25 #include <unordered_map>
27 namespace hwcomposer {
30 using HwcRect = Rect<T>;
32 typedef std::vector<HwcRect<int>> HwcRegion;
34 enum class HWCBlending : int32_t {
35 kBlendingNone = 0x0100,
36 kBlendingPremult = 0x0105,
37 kBlendingCoverage = 0x0405,
44 kTransform90 = 1 << 2,
45 kTransform180 = 1 << 3,
46 kTransform270 = 1 << 4,
47 kTransform45 = kTransform90 | kReflectY,
48 kTransform135 = kTransform90 | kReflectX,
67 enum class HWCDisplayAttribute : int32_t {
75 enum class DisplayType : int32_t {
84 enum DisplayPowerMode {
85 kOff = 0, // Display is off
86 kDoze = 1, // Display is off and used by the app during any inactivity
87 // when the device is on battery
88 kOn = 2, // Display is on
89 kDozeSuspend = 3 // Dispaly in low power mode and stop applying
90 // updates from the client
93 enum HWCColorTransform {
94 kIdentical = 0, // Applies no transform to the output color
95 kArbitraryMatrix = 1 // Applies an arbitrary transform defined by a 4x4 affine matrix
98 enum class HWCColorControl : int32_t {
100 kColorSaturation = 1,
101 kColorBrightness = 2,
106 struct EnumClassHash {
107 template <typename T>
108 std::size_t operator()(T t) const {
109 return static_cast<std::size_t>(t);
113 struct HWCColorProp {
115 bool use_default_ = true;
119 std::unordered_map<HWCColorControl, HWCColorProp, EnumClassHash>;
121 } // namespace hwcomposer
122 #endif // PUBLIC_HWCDEFS_H_