surfaceflinger: Reimplement hwrotation

Change-Id: Ia26bb36b5b6de132af49c272c4472ad2703afbda
This commit is contained in:
Ricardo Cerqueira 2012-11-24 23:11:49 +00:00 committed by Steve Kondik
parent b9127bdbe3
commit 94d724071d
1 changed files with 14 additions and 0 deletions

View File

@ -392,6 +392,20 @@ status_t DisplayDevice::orientationToTransfrom(
int orientation, int w, int h, Transform* tr)
{
uint32_t flags = 0;
char value[PROPERTY_VALUE_MAX];
property_get("ro.sf.hwrotation", value, "0");
int additionalRot = atoi(value);
if (additionalRot) {
additionalRot /= 90;
if (orientation == DisplayState::eOrientationUnchanged) {
orientation = additionalRot;
} else {
orientation += additionalRot;
orientation %= 4;
}
}
switch (orientation) {
case DisplayState::eOrientationDefault:
flags = Transform::ROT_0;