1/*
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"
21#include "Hwc2TestProperties.h"
22
23#define HWC2_INCLUDE_STRINGIFICATION
24#define HWC2_USE_CPP11
25#include <hardware/hwcomposer2.h>
26#undef HWC2_INCLUDE_STRINGIFICATION
27#undef HWC2_USE_CPP11
28
29class Hwc2TestVirtualDisplay {
30public:
31    Hwc2TestVirtualDisplay(Hwc2TestCoverage coverage);
32
33    std::string dump() const;
34
35    int getBuffer(buffer_handle_t* outHandle,
36            android::base::unique_fd* outAcquireFence);
37
38    void reset();
39    bool advance();
40
41    UnsignedArea getDisplayDimension() const;
42
43private:
44    Hwc2TestBuffer mBuffer;
45
46    Hwc2TestDisplayDimension mDisplayDimension;
47};
48
49#endif /* ifndef _HWC2_TEST_VIRTUAL_DISPLAY_H */
50