From 5f35514b9eee0dee777d3c7f94ac350e6aa5c9d1 Mon Sep 17 00:00:00 2001 From: Clyde Tan Date: Mon, 30 Dec 2013 08:30:49 +0800 Subject: Fix boot animation rotation problem when ro.sf.hwrotation is set to 90 or 270 Change-Id: I523204540ead9be61e5dc186fa6bbad7c468c3c4 --- services/surfaceflinger/DisplayDevice.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index fce66c8c6..92511ac96 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -392,7 +392,14 @@ void DisplayDevice::setProjection(int orientation, if (!frame.isValid()) { // the destination frame can be invalid if it has never been set, // in that case we assume the whole display frame. - frame = Rect(w, h); + char value[PROPERTY_VALUE_MAX]; + property_get("ro.sf.hwrotation", value, "0"); + int additionalRot = atoi(value); + + if (additionalRot == 90 || additionalRot == 270) + frame = Rect(h, w); + else + frame = Rect(w, h); } if (viewport.isEmpty()) { -- cgit v1.2.3