blob: b4c3558a3600a91b8585a4b2c8bc57014d4612ae [file] [log] [blame]
Marissa Wall273b1df2016-12-15 12:28:47 -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#ifndef _HWC2_TEST_LAYERS_H
18#define _HWC2_TEST_LAYERS_H
19
20#include <map>
21
22#define HWC2_INCLUDE_STRINGIFICATION
23#define HWC2_USE_CPP11
24#include <hardware/hwcomposer2.h>
25#undef HWC2_INCLUDE_STRINGIFICATION
26#undef HWC2_USE_CPP11
27
28#include "Hwc2TestProperties.h"
29#include "Hwc2TestLayer.h"
30
31class Hwc2TestLayers {
32public:
33 Hwc2TestLayers(const std::vector<hwc2_layer_t>& layers,
Marissa Wall600a73b2016-12-15 12:30:39 -080034 Hwc2TestCoverage coverage, const Area& displayArea);
Marissa Wall273b1df2016-12-15 12:28:47 -080035
36 std::string dump() const;
37
38 void reset();
39
Marissa Wall1cd789c2017-01-27 12:55:36 -080040 bool advance();
Marissa Wallf7618ed2016-12-15 12:34:39 -080041 bool advanceVisibleRegions();
42
Marissa Wall1cd789c2017-01-27 12:55:36 -080043 bool contains(hwc2_layer_t layer) const;
44
45 int getBuffer(hwc2_layer_t layer, buffer_handle_t* outHandle,
46 int32_t* outAcquireFence);
47
48 hwc2_blend_mode_t getBlendMode(hwc2_layer_t layer) const;
49 hwc_color_t getColor(hwc2_layer_t layer) const;
50 hwc2_composition_t getComposition(hwc2_layer_t layer) const;
51 hwc_rect_t getCursorPosition(hwc2_layer_t layer) const;
52 android_dataspace_t getDataspace(hwc2_layer_t layer) const;
53 hwc_rect_t getDisplayFrame(hwc2_layer_t layer) const;
54 android_pixel_format_t getFormat(hwc2_layer_t layer) const;
55 float getPlaneAlpha(hwc2_layer_t layer) const;
56 hwc_frect_t getSourceCrop(hwc2_layer_t layer) const;
57 hwc_region_t getSurfaceDamage(hwc2_layer_t layer) const;
58 hwc_transform_t getTransform(hwc2_layer_t layer) const;
59 hwc_region_t getVisibleRegion(hwc2_layer_t layer) const;
60 uint32_t getZOrder(hwc2_layer_t layer) const;
Marissa Wall273b1df2016-12-15 12:28:47 -080061
62private:
Marissa Wallf7618ed2016-12-15 12:34:39 -080063 void setVisibleRegions();
64
Marissa Wall273b1df2016-12-15 12:28:47 -080065 std::map<hwc2_layer_t, Hwc2TestLayer> mTestLayers;
Marissa Wall1cd789c2017-01-27 12:55:36 -080066
67 Area mDisplayArea;
Marissa Wall273b1df2016-12-15 12:28:47 -080068};
69
70#endif /* ifndef _HWC2_TEST_LAYERS_H */