This repository was archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathrenderstate.h
More file actions
98 lines (82 loc) · 2.41 KB
/
renderstate.h
File metadata and controls
98 lines (82 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
// Copyright (c) 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#ifndef COMMON_COMPOSITOR_RENDERSTATE_H_
#define COMMON_COMPOSITOR_RENDERSTATE_H_
#include <vector>
#include <stdint.h>
#include <unistd.h>
#include "compositordefs.h"
#include "hwcdefs.h"
namespace hwcomposer {
struct OverlayLayer;
struct CompositionRegion;
class NativeGpuResource;
class NativeSurface;
class OverlayBuffer;
struct RenderState {
struct LayerState {
float crop_bounds_[4];
float alpha_;
float premult_;
float texture_matrix_[4];
uint32_t layer_index_;
uint8_t *solid_color_array_;
GpuResourceHandle handle_;
};
void ConstructState(std::vector<OverlayLayer> &layers,
const CompositionRegion ®ion,
uint32_t downscaling_factor, bool uses_display_up_scaling,
bool use_plane_transform);
uint32_t x_;
uint32_t y_;
uint32_t width_;
uint32_t height_;
uint32_t scissor_x_;
uint32_t scissor_y_;
uint32_t scissor_width_;
uint32_t scissor_height_;
std::vector<LayerState> layer_state_;
};
struct MediaState {
std::vector<OverlayLayer *> layers_;
HWCColorMap colors_;
HWCDeinterlaceProp deinterlace_;
uint32_t scaling_mode_;
};
struct DrawState {
~DrawState() {
for (int32_t fence : acquire_fences_) {
close(fence);
}
}
DrawState() = default;
DrawState(DrawState &&other) {
surface_ = other.surface_;
destroy_surface_ = other.destroy_surface_;
retire_fence_ = other.retire_fence_;
states_.swap(other.states_);
acquire_fences_.swap(other.acquire_fences_);
media_state_ = std::move(other.media_state_);
}
std::vector<RenderState> states_;
MediaState media_state_;
NativeSurface *surface_;
bool destroy_surface_ = false;
int32_t retire_fence_ = -1;
std::vector<int32_t> acquire_fences_;
};
} // namespace hwcomposer
#endif // COMMON_COMPOSITOR_RENDERSTATE_H_