blob: a51cc67b1d8cc1326ea19e1d164465aea0b3af9c [file] [log] [blame]
Lloyd Pique35d58242018-12-18 16:33:25 -08001/*
2 * Copyright 2019 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#pragma once
18
19#include <gmock/gmock.h>
20#include <ui/Fence.h>
21#include <ui/FloatRect.h>
22#include <ui/GraphicBuffer.h>
Lloyd Pique3b5a69e2020-01-16 17:51:01 -080023
Lloyd Pique35d58242018-12-18 16:33:25 -080024#include <ui/Rect.h>
25#include <ui/Region.h>
26#include <ui/Transform.h>
27
Lloyd Pique3b5a69e2020-01-16 17:51:01 -080028// TODO(b/129481165): remove the #pragma below and fix conversion issues
29#pragma clang diagnostic push
30#pragma clang diagnostic ignored "-Wconversion"
31
32#include <ui/GraphicTypes.h>
Lloyd Pique35d58242018-12-18 16:33:25 -080033#include "DisplayHardware/HWC2.h"
34
Lloyd Pique3b5a69e2020-01-16 17:51:01 -080035// TODO(b/129481165): remove the #pragma below and fix conversion issues
36#pragma clang diagnostic pop // ignored "-Wconversion"
37
Lloyd Pique35d58242018-12-18 16:33:25 -080038namespace HWC2 {
39namespace mock {
40
41class Layer : public HWC2::Layer {
42public:
43 Layer();
44 ~Layer() override;
45
46 MOCK_CONST_METHOD0(getId, hwc2_layer_t());
47
48 MOCK_METHOD2(setCursorPosition, Error(int32_t, int32_t));
49 MOCK_METHOD3(setBuffer,
50 Error(uint32_t, const android::sp<android::GraphicBuffer>&,
51 const android::sp<android::Fence>&));
52 MOCK_METHOD1(setSurfaceDamage, Error(const android::Region&));
53 MOCK_METHOD1(setBlendMode, Error(BlendMode));
54 MOCK_METHOD1(setColor, Error(hwc_color_t));
55 MOCK_METHOD1(setCompositionType, Error(Composition));
56 MOCK_METHOD1(setDataspace, Error(android::ui::Dataspace));
57 MOCK_METHOD2(setPerFrameMetadata, Error(const int32_t, const android::HdrMetadata&));
58 MOCK_METHOD1(setDisplayFrame, Error(const android::Rect&));
59 MOCK_METHOD1(setPlaneAlpha, Error(float));
60 MOCK_METHOD1(setSidebandStream, Error(const native_handle_t*));
61 MOCK_METHOD1(setSourceCrop, Error(const android::FloatRect&));
62 MOCK_METHOD1(setTransform, Error(Transform));
63 MOCK_METHOD1(setVisibleRegion, Error(const android::Region&));
64 MOCK_METHOD1(setZOrder, Error(uint32_t));
65 MOCK_METHOD2(setInfo, Error(uint32_t, uint32_t));
66
67 MOCK_METHOD1(setColorTransform, Error(const android::mat4&));
68};
69
70} // namespace mock
71} // namespace HWC2