Revert "surfaceflinger: Consolidate display orientation compensation hooks"

* This is completely breaking graphics.

This reverts commit f8e2372ad7.

Change-Id: I1d694f4228199891a191ce3fb924cec71a6100f0
This commit is contained in:
Steve Kondik 2015-11-10 23:58:38 +01:00
parent f8e2372ad7
commit af9298115c
3 changed files with 11 additions and 15 deletions

View File

@ -84,7 +84,6 @@ DisplayDevice::DisplayDevice(
mIsSecure(isSecure),
mSecureLayerVisible(false),
mLayerStack(NO_LAYER_STACK),
mHardwareOrientation(0),
mOrientation(),
mPowerMode(HWC_POWER_MODE_OFF),
mActiveConfig(0)
@ -132,12 +131,7 @@ DisplayDevice::DisplayDevice(
// was created with createDisplay().
switch (mType) {
case DISPLAY_PRIMARY:
char value[PROPERTY_VALUE_MAX];
mDisplayName = "Built-in Screen";
/* hwrotation applies only to the primary display */
property_get("ro.sf.hwrotation", value, "0");
mHardwareOrientation = atoi(value);
break;
case DISPLAY_EXTERNAL:
mDisplayName = "HDMI Screen";
@ -398,7 +392,9 @@ status_t DisplayDevice::orientationToTransfrom(
int orientation, int w, int h, Transform* tr)
{
uint32_t flags = 0;
int additionalRot = this->getHardwareOrientation();
char value[PROPERTY_VALUE_MAX];
property_get("ro.sf.hwrotation", value, "0");
int additionalRot = atoi(value);
if (additionalRot) {
additionalRot /= 90;
@ -470,7 +466,11 @@ 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.
if ((mHardwareOrientation/90) & DisplayState::eOrientationSwapMask) {
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);
@ -529,10 +529,6 @@ void DisplayDevice::setProjection(int orientation,
mFrame = frame;
}
int DisplayDevice::getHardwareOrientation() {
return mHardwareOrientation;
}
void DisplayDevice::dump(String8& result) const {
const Transform& tr(mGlobalTransform);
result.appendFormat(

View File

@ -173,7 +173,6 @@ public:
*/
uint32_t getPageFlipCount() const;
void dump(String8& result) const;
int getHardwareOrientation();
private:
/*
@ -218,7 +217,6 @@ private:
int w, int h, Transform* tr);
uint32_t mLayerStack;
int mHardwareOrientation;
int mOrientation;
// user-provided visible area of the layer stack
Rect mViewport;

View File

@ -641,7 +641,9 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display,
info.orientation = 0;
}
int additionalRot = mDisplays[0]->getHardwareOrientation() / 90;
char value[PROPERTY_VALUE_MAX];
property_get("ro.sf.hwrotation", value, "0");
int additionalRot = atoi(value) / 90;
if ((type == DisplayDevice::DISPLAY_PRIMARY) && (additionalRot & DisplayState::eOrientationSwapMask)) {
info.h = hwConfig.width;
info.w = hwConfig.height;