blob: 8a2586e9f8d0afb33bb2fdd142a8fcf6ae914f4f [file] [log] [blame]
Sally Qi147581b2023-06-27 11:55:34 -07001/**
2 * Copyright (C) 2023 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 "Utils/OverlayUtils.h"
20
21#include <ui/Size.h>
22#include <utils/StrongPointer.h>
23
24class SkCanvas;
25
26namespace android {
27class HdrSdrRatioOverlay {
28public:
29 HdrSdrRatioOverlay();
30 void setLayerStack(ui::LayerStack);
31 void setViewport(ui::Size);
32 void animate();
33 void changeHdrSdrRatio(float currentRatio);
34
35private:
36 float mCurrentHdrSdrRatio = 1.f;
37
38 static sp<GraphicBuffer> draw(float currentHdrSdrRatio, SkColor, ui::Transform::RotationFlags);
39 static void drawNumber(float number, int left, SkColor, SkCanvas&);
40
41 const sp<GraphicBuffer> getOrCreateBuffers(float currentHdrSdrRatio);
42
43 const std::unique_ptr<SurfaceControlHolder> mSurfaceControl;
44};
45} // namespace android