blob: ce29bc32434a52d235329712a80259dee6e42dbc [file] [log] [blame]
Ady Abraham03b02dd2019-03-21 15:40:11 -07001/*
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#pragma once
17
18#include "SurfaceFlinger.h"
19
20namespace android {
21
22using RefreshRateType = scheduler::RefreshRateConfigs::RefreshRateType;
23
24class RefreshRateOverlay {
25public:
26 RefreshRateOverlay(SurfaceFlinger& flinger);
27
28 void changeRefreshRate(RefreshRateType type);
29
30private:
31 bool createLayer();
32
33 SurfaceFlinger& mFlinger;
34 sp<Client> mClient;
35 sp<Layer> mLayer;
36 sp<IBinder> mIBinder;
37 sp<IGraphicBufferProducer> mGbp;
38
39 const half3 RED = half3(1.0f, 0.0f, 0.0f);
40 const half3 GREEN = half3(0.0f, 1.0f, 0.0f);
41};
42
43}; // namespace android