hwc: utils: Include orientation while screen-fitting.
MDP doesn't like out-of-screen-bounds parameters. So based on the position of
the layer, we adjust the portion of layer the MDP should pick.
However, this did not factor in orientation, so far. This patch does that and
allows panning to work in other orientations, without having to use GPU.
Bug: 7313955
Change-Id: Ice17ad144abcd60279c2ef9ad87fc617a1bd3621
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 0307e10..9193540 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -91,7 +91,7 @@
void closeContext(hwc_context_t *ctx);
//Crops source buffer against destination and FB boundaries
void calculate_crop_rects(hwc_rect_t& crop, hwc_rect_t& dst,
- const int fbWidth, const int fbHeight);
+ const int fbWidth, const int fbHeight, int orient);
bool isExternalActive(hwc_context_t* ctx);
@@ -154,6 +154,13 @@
return fd;
}
+template <class T>
+inline void swap(T& a, T& b) {
+ T tmp = a;
+ a = b;
+ b = tmp;
+}
+
}; //qhwc namespace
struct vsync_state {