blob: 5445a770c0a4bc221c2ace2e2d0679fc44e93b44 [file] [log] [blame]
Marissa Wall6bd8bfd2016-12-15 12:25:31 -08001/*
2 * Copyright (C) 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#include <sstream>
18
19#include "Hwc2TestLayer.h"
20
21Hwc2TestLayer::Hwc2TestLayer(Hwc2TestCoverage coverage)
Marissa Wallffc67da2016-12-15 12:26:09 -080022 : mBlendMode(coverage),
Marissa Wallb72b5c92016-12-15 12:26:39 -080023 mComposition(coverage),
Marissa Wall2b1f5302016-12-15 12:27:20 -080024 mDataspace(coverage),
Marissa Wallac108192016-12-15 12:27:48 -080025 mPlaneAlpha(coverage),
26 mTransform(coverage) { }
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080027
28std::string Hwc2TestLayer::dump() const
29{
30 std::stringstream dmp;
31
32 dmp << "layer: \n";
Marissa Wallffc67da2016-12-15 12:26:09 -080033
34 for (auto property : mProperties) {
35 dmp << property->dump();
36 }
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080037
38 return dmp.str();
39}
40
41void Hwc2TestLayer::reset()
42{
Marissa Wallffc67da2016-12-15 12:26:09 -080043 for (auto property : mProperties) {
44 property->reset();
45 }
46}
47
48hwc2_blend_mode_t Hwc2TestLayer::getBlendMode() const
49{
50 return mBlendMode.get();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080051}
52
53hwc2_composition_t Hwc2TestLayer::getComposition() const
54{
55 return mComposition.get();
56}
57
Marissa Wallb72b5c92016-12-15 12:26:39 -080058android_dataspace_t Hwc2TestLayer::getDataspace() const
59{
60 return mDataspace.get();
61}
62
Marissa Wall2b1f5302016-12-15 12:27:20 -080063float Hwc2TestLayer::getPlaneAlpha() const
64{
65 return mPlaneAlpha.get();
66}
67
Marissa Wallac108192016-12-15 12:27:48 -080068hwc_transform_t Hwc2TestLayer::getTransform() const
69{
70 return mTransform.get();
71}
72
Marissa Wallffc67da2016-12-15 12:26:09 -080073bool Hwc2TestLayer::advanceBlendMode()
74{
75 return mBlendMode.advance();
76}
77
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080078bool Hwc2TestLayer::advanceComposition()
79{
80 return mComposition.advance();
81}
Marissa Wallb72b5c92016-12-15 12:26:39 -080082
83bool Hwc2TestLayer::advanceDataspace()
84{
85 return mDataspace.advance();
86}
Marissa Wall2b1f5302016-12-15 12:27:20 -080087
88bool Hwc2TestLayer::advancePlaneAlpha()
89{
90 return mPlaneAlpha.advance();
91}
Marissa Wallac108192016-12-15 12:27:48 -080092
93bool Hwc2TestLayer::advanceTransform()
94{
95 return mTransform.advance();
96}