drm_hwcomposer: Reorganize struct DrmHwcLayer
1. Move BlendMode, ColorSpace, SampleRange fields to the struct BufferInfo,
allowing extraction of the data from native_handle using Metadata@4 API.
Use it when data from HWC2 API can't be used (Currently it's a BlendMode
case for CLIENT layer)
2. Rename DrmHwcLayer to LayerData and move it to compositor/ directory.
(I was confused in the past because of similarity of names DrmHwcLayer
vs HwcLayer, so this step should meke it easier for newcomers to
understand the code)
3. Allow clonning of the LayerData to propagate it through the composition
pipeline. Thus LayerData can be used by both HwcLayer to track state
and by the compositor.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
diff --git a/backend/Backend.cpp b/backend/Backend.cpp
index f6d9c18..ba0518a 100644
--- a/backend/Backend.cpp
+++ b/backend/Backend.cpp
@@ -83,9 +83,9 @@
bool Backend::IsClientLayer(HwcDisplay *display, HwcLayer *layer) {
return !HardwareSupportsLayerType(layer->GetSfType()) ||
- !BufferInfoGetter::GetInstance()->IsHandleUsable(layer->GetBuffer()) ||
+ !layer->IsLayerUsableAsDevice() ||
display->color_transform_hint() != HAL_COLOR_TRANSFORM_IDENTITY ||
- (layer->RequireScalingOrPhasing() &&
+ (layer->GetLayerData().pi.RequireScalingOrPhasing() &&
display->GetHwc2()->GetResMan().ForcedScalingWithGpu());
}
@@ -99,7 +99,7 @@
uint32_t pixops = 0;
for (size_t z_order = 0; z_order < layers.size(); ++z_order) {
if (z_order >= first_z && z_order < first_z + size) {
- hwc_rect_t df = layers[z_order]->GetDisplayFrame();
+ hwc_rect_t &df = layers[z_order]->GetLayerData().pi.display_frame;
pixops += (df.right - df.left) * (df.bottom - df.top);
}
}