blob: 10c8ef0f1cfa41fbbaff8e7d96d89af5778382fb [file] [log] [blame]
Marissa Wallbad1bc72017-02-21 14:33:46 -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_VIRTUAL_DISPLAY_H
18#define _HWC2_TEST_VIRTUAL_DISPLAY_H
19
20#include "Hwc2TestBuffer.h"
David Hanna Jr3f056022017-07-27 19:19:15 -070021#include "Hwc2TestPixelComparator.h"
Marissa Wallbad1bc72017-02-21 14:33:46 -080022#include "Hwc2TestProperties.h"
23
24#define HWC2_INCLUDE_STRINGIFICATION
25#define HWC2_USE_CPP11
26#include <hardware/hwcomposer2.h>
27#undef HWC2_INCLUDE_STRINGIFICATION
28#undef HWC2_USE_CPP11
29
30class Hwc2TestVirtualDisplay {
31public:
32 Hwc2TestVirtualDisplay(Hwc2TestCoverage coverage);
33
34 std::string dump() const;
35
David Hanna Jr3f056022017-07-27 19:19:15 -070036 int getOutputBuffer(buffer_handle_t* outHandle,
Marissa Wallbad1bc72017-02-21 14:33:46 -080037 android::base::unique_fd* outAcquireFence);
38
David Hanna Jr3f056022017-07-27 19:19:15 -070039 int verifyOutputBuffer(const Hwc2TestLayers* testLayers,
40 const std::vector<hwc2_layer_t>* allLayers,
41 const std::set<hwc2_layer_t>* clearLayers);
42
43 int writeBuffersToFile(std::string name);
Marissa Wallbad1bc72017-02-21 14:33:46 -080044 void reset();
45 bool advance();
46
47 UnsignedArea getDisplayDimension() const;
48
49private:
David Hanna Jr3f056022017-07-27 19:19:15 -070050 Hwc2TestOutputBuffer mOutputBuffer;
51 Hwc2TestExpectedBuffer mExpectedBuffer;
Marissa Wallbad1bc72017-02-21 14:33:46 -080052 Hwc2TestDisplayDimension mDisplayDimension;
53};
54
55#endif /* ifndef _HWC2_TEST_VIRTUAL_DISPLAY_H */