blob: 647f0ff0e22d2b69970fb3931520d71676c07927 [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),
25 mPlaneAlpha(coverage) { }
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080026
27std::string Hwc2TestLayer::dump() const
28{
29 std::stringstream dmp;
30
31 dmp << "layer: \n";
Marissa Wallffc67da2016-12-15 12:26:09 -080032
33 for (auto property : mProperties) {
34 dmp << property->dump();
35 }
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080036
37 return dmp.str();
38}
39
40void Hwc2TestLayer::reset()
41{
Marissa Wallffc67da2016-12-15 12:26:09 -080042 for (auto property : mProperties) {
43 property->reset();
44 }
45}
46
47hwc2_blend_mode_t Hwc2TestLayer::getBlendMode() const
48{
49 return mBlendMode.get();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080050}
51
52hwc2_composition_t Hwc2TestLayer::getComposition() const
53{
54 return mComposition.get();
55}
56
Marissa Wallb72b5c92016-12-15 12:26:39 -080057android_dataspace_t Hwc2TestLayer::getDataspace() const
58{
59 return mDataspace.get();
60}
61
Marissa Wall2b1f5302016-12-15 12:27:20 -080062float Hwc2TestLayer::getPlaneAlpha() const
63{
64 return mPlaneAlpha.get();
65}
66
Marissa Wallffc67da2016-12-15 12:26:09 -080067bool Hwc2TestLayer::advanceBlendMode()
68{
69 return mBlendMode.advance();
70}
71
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080072bool Hwc2TestLayer::advanceComposition()
73{
74 return mComposition.advance();
75}
Marissa Wallb72b5c92016-12-15 12:26:39 -080076
77bool Hwc2TestLayer::advanceDataspace()
78{
79 return mDataspace.advance();
80}
Marissa Wall2b1f5302016-12-15 12:27:20 -080081
82bool Hwc2TestLayer::advancePlaneAlpha()
83{
84 return mPlaneAlpha.advance();
85}