sdm: Update layer parameters based on panel orientation
Update layer rotation parameters with panel orientation.
Recalculate destination rect for all layers.
CRs-fixed: 1112326
Change-Id: I95f6428c77b23cf2437c319f6ab519aa3ad245e9
diff --git a/sdm/libs/utils/rect.cpp b/sdm/libs/utils/rect.cpp
index fc553a3..dd5a872 100644
--- a/sdm/libs/utils/rect.cpp
+++ b/sdm/libs/utils/rect.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -223,6 +223,20 @@
out_rect->bottom = dst_domain.top + (height_ratio * modified_in_rect.bottom);
}
+void TransformHV(const LayerRect &src_domain, const LayerRect &in_rect, LayerRect *out_rect) {
+ if (!IsValid(src_domain) || !IsValid(in_rect)) {
+ return;
+ }
+
+ float in_width = in_rect.right - in_rect.left;
+ float in_height = in_rect.bottom - in_rect.top;
+
+ out_rect->right = src_domain.right - in_rect.left;
+ out_rect->bottom = src_domain.bottom - in_rect.top;
+ out_rect->left = out_rect->right - in_width;
+ out_rect->top = out_rect->bottom - in_height;
+}
+
RectOrientation GetOrientation(const LayerRect &in_rect) {
if (!IsValid(in_rect)) {
return kOrientationUnknown;