| Marissa Wall | bad1bc7 | 2017-02-21 14:33:46 -0800 | [diff] [blame] | 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" | 
| David Hanna Jr | 3f05602 | 2017-07-27 19:19:15 -0700 | [diff] [blame] | 21 | #include "Hwc2TestPixelComparator.h" | 
| Marissa Wall | bad1bc7 | 2017-02-21 14:33:46 -0800 | [diff] [blame] | 22 | #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 |  | 
|  | 30 | class Hwc2TestVirtualDisplay { | 
|  | 31 | public: | 
| Chih-Hung Hsieh | 2274904 | 2018-12-20 15:50:39 -0800 | [diff] [blame] | 32 | explicit Hwc2TestVirtualDisplay(Hwc2TestCoverage coverage); | 
| Marissa Wall | bad1bc7 | 2017-02-21 14:33:46 -0800 | [diff] [blame] | 33 |  | 
|  | 34 | std::string dump() const; | 
|  | 35 |  | 
| David Hanna Jr | 3f05602 | 2017-07-27 19:19:15 -0700 | [diff] [blame] | 36 | int getOutputBuffer(buffer_handle_t* outHandle, | 
| Marissa Wall | bad1bc7 | 2017-02-21 14:33:46 -0800 | [diff] [blame] | 37 | android::base::unique_fd* outAcquireFence); | 
|  | 38 |  | 
| David Hanna Jr | 3f05602 | 2017-07-27 19:19:15 -0700 | [diff] [blame] | 39 | 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 Wall | bad1bc7 | 2017-02-21 14:33:46 -0800 | [diff] [blame] | 44 | void reset(); | 
|  | 45 | bool advance(); | 
|  | 46 |  | 
|  | 47 | UnsignedArea getDisplayDimension() const; | 
|  | 48 |  | 
|  | 49 | private: | 
| David Hanna Jr | 3f05602 | 2017-07-27 19:19:15 -0700 | [diff] [blame] | 50 | Hwc2TestOutputBuffer mOutputBuffer; | 
|  | 51 | Hwc2TestExpectedBuffer mExpectedBuffer; | 
| Marissa Wall | bad1bc7 | 2017-02-21 14:33:46 -0800 | [diff] [blame] | 52 | Hwc2TestDisplayDimension mDisplayDimension; | 
|  | 53 | }; | 
|  | 54 |  | 
|  | 55 | #endif /* ifndef _HWC2_TEST_VIRTUAL_DISPLAY_H */ |