diff options
author | Iris Chang <iris.chang@mediatek.com> | 2018-07-01 23:29:11 +0800 |
---|---|---|
committer | Ćukasz Patron <priv.luk@gmail.com> | 2018-08-07 10:38:24 +0200 |
commit | a15be7bf3a6b7bed8a117cb6f3291fd6a77cca9e (patch) | |
tree | 4d20abe0d1e03730beb685af17dd16a3498cb65d | |
parent | b3eca0515ec6cfee0a8bf9f18b7b2170579e316f (diff) | |
download | android_frameworks_native-a15be7bf3a6b7bed8a117cb6f3291fd6a77cca9e.tar.gz android_frameworks_native-a15be7bf3a6b7bed8a117cb6f3291fd6a77cca9e.tar.bz2 android_frameworks_native-a15be7bf3a6b7bed8a117cb6f3291fd6a77cca9e.zip |
DO NOT MERGE: Fix landscape LCM issue
When device uses landscape LCM, the nature of the screen shows that
the device is a portrait device. In this case, we find GPU filter
function is opened by mistake when capturing screen and CTS case
fails because image pixel value is changed.
The solution is to correct the GPU filter by hworientation.
Bug: 69691076
Test:
1. Capture screen
2. android.uirendering.cts.testclasses.SurfaceViewTests#testMovingWhiteSurfaceView
Change-Id: I67b75fc8fab188d24f1d5febff20d9bd10c15204
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index e45f717cc..33abd807f 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4384,8 +4384,14 @@ void SurfaceFlinger::renderScreenImplLocked( // get screen geometry const int32_t hw_w = hw->getWidth(); const int32_t hw_h = hw->getHeight(); - const bool filtering = static_cast<int32_t>(reqWidth) != hw_w || - static_cast<int32_t>(reqHeight) != hw_h; + bool filtering = false; + if (mHwOrientation & DisplayState::eOrientationSwapMask) { + filtering = static_cast<int32_t>(reqWidth) != hw_h || + static_cast<int32_t>(reqHeight) != hw_w; + } else { + filtering = static_cast<int32_t>(reqWidth) != hw_w || + static_cast<int32_t>(reqHeight) != hw_h; + } // if a default or invalid sourceCrop is passed in, set reasonable values if (sourceCrop.width() == 0 || sourceCrop.height() == 0 || |