blob: 414bc47ac91cb9b1dadb0d585b0ecc43a6b955ca [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
Ady Abraham2139f732019-11-13 18:56:40 -080022using RefreshRate = scheduler::RefreshRateConfigs::RefreshRate;
Ady Abraham03b02dd2019-03-21 15:40:11 -070023
24class RefreshRateOverlay {
25public:
26 RefreshRateOverlay(SurfaceFlinger& flinger);
27
Ady Abraham2139f732019-11-13 18:56:40 -080028 void changeRefreshRate(const RefreshRate& refreshRate);
Ady Abraham03b02dd2019-03-21 15:40:11 -070029
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