summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Stoza2016-03-16 14:23:40 -0500
committerDan Stoza2016-04-08 14:32:08 -0500
commit7d7ae7345abfb91be55c4aed6c9be9d09a144e4c (patch)
tree2c847a881e0e5a2ee57bdffad215773b07afd04e /include
parented40eba4c1264806a1b795bf45b0dea366ee9975 (diff)
downloadframeworks-native-7d7ae7345abfb91be55c4aed6c9be9d09a144e4c.tar.gz
frameworks-native-7d7ae7345abfb91be55c4aed6c9be9d09a144e4c.tar.xz
frameworks-native-7d7ae7345abfb91be55c4aed6c9be9d09a144e4c.zip
HWC2: Add getHdrCapabilities to C++ shim
Adds support for the getHdrCapabilities call to the HWC2 C++ shim. Bug: 25684127 Change-Id: Ib4635ee437a06b48945e7f0328492c1e74e27aaa
Diffstat (limited to 'include')
-rw-r--r--include/ui/HdrCapabilities.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/ui/HdrCapabilities.h b/include/ui/HdrCapabilities.h
new file mode 100644
index 000000000..a7cd5fb58
--- /dev/null
+++ b/include/ui/HdrCapabilities.h
@@ -0,0 +1,66 @@
1/*
2 * Copyright 2016 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_UI_HDR_CAPABILTIES_H
18#define ANDROID_UI_HDR_CAPABILTIES_H
19
20#include <binder/Parcelable.h>
21
22namespace android {
23
24class HdrCapabilities : public Parcelable
25{
26public:
27 HdrCapabilities(const std::vector<int32_t /*android_hdr_t*/>& types,
28 float maxLuminance, float maxAverageLuminance, float minLuminance)
29 : mSupportedHdrTypes(types),
30 mMaxLuminance(maxLuminance),
31 mMaxAverageLuminance(maxAverageLuminance),
32 mMinLuminance(minLuminance) {}
33
34 // Make this move-constructable and move-assignable
35 HdrCapabilities(HdrCapabilities&& other) = default;
36 HdrCapabilities& operator=(HdrCapabilities&& other) = default;
37
38 HdrCapabilities()
39 : mSupportedHdrTypes(),
40 mMaxLuminance(-1.0f),
41 mMaxAverageLuminance(-1.0f),
42 mMinLuminance(-1.0f) {}
43
44 virtual ~HdrCapabilities() = default;
45
46 const std::vector<int32_t /*android_hdr_t*/>& getSupportedHdrTypes() const {
47 return mSupportedHdrTypes;
48 }
49 float getDesiredMaxLuminance() const { return mMaxLuminance; }
50 float getDesiredMaxAverageLuminance() const { return mMaxAverageLuminance; }
51 float getDesiredMinLuminance() const { return mMinLuminance; }
52
53 // Parcelable interface
54 virtual status_t writeToParcel(Parcel* parcel) const override;
55 virtual status_t readFromParcel(const Parcel* parcel) override;
56
57private:
58 std::vector<int32_t /*android_hdr_t*/> mSupportedHdrTypes;
59 float mMaxLuminance;
60 float mMaxAverageLuminance;
61 float mMinLuminance;
62};
63
64} // namespace android
65
66#endif