Loading libs/gui/SurfaceComposerClient.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -629,7 +629,7 @@ status_t SurfaceComposerClient::createSurfaceChecked( int32_t ownerUid) { sp<SurfaceControl> sur; status_t err = NO_ERROR; status_t err = mStatus; if (mStatus == NO_ERROR) { sp<IBinder> handle; Loading libs/gui/tests/Surface_test.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ static constexpr uint64_t NO_FRAME_INDEX = std::numeric_limits<uint64_t>::max(); class SurfaceTest : public ::testing::Test { protected: SurfaceTest() { ProcessState::self()->startThreadPool(); } Loading Loading @@ -93,6 +92,16 @@ protected: sp<SurfaceControl> mSurfaceControl; }; TEST_F(SurfaceTest, CreateSurfaceReturnsErrorBadClient) { mComposerClient->dispose(); ASSERT_EQ(NO_INIT, mComposerClient->initCheck()); sp<SurfaceControl> sc; status_t err = mComposerClient->createSurfaceChecked( String8("Test Surface"), 32, 32, PIXEL_FORMAT_RGBA_8888, &sc, 0); ASSERT_EQ(NO_INIT, err); } TEST_F(SurfaceTest, QueuesToWindowComposerIsTrueWhenVisible) { sp<ANativeWindow> anw(mSurface); int result = -123; Loading services/inputflinger/InputDispatcher.cpp +36 −6 Original line number Diff line number Diff line Loading @@ -105,6 +105,36 @@ static inline const char* toString(bool value) { return value ? "true" : "false"; } static std::string motionActionToString(int32_t action) { // Convert MotionEvent action to string switch(action & AMOTION_EVENT_ACTION_MASK) { case AMOTION_EVENT_ACTION_DOWN: return "DOWN"; case AMOTION_EVENT_ACTION_MOVE: return "MOVE"; case AMOTION_EVENT_ACTION_UP: return "UP"; case AMOTION_EVENT_ACTION_POINTER_DOWN: return "POINTER_DOWN"; case AMOTION_EVENT_ACTION_POINTER_UP: return "POINTER_UP"; } return StringPrintf("%" PRId32, action); } static std::string keyActionToString(int32_t action) { // Convert KeyEvent action to string switch(action) { case AKEY_EVENT_ACTION_DOWN: return "DOWN"; case AKEY_EVENT_ACTION_UP: return "UP"; case AKEY_EVENT_ACTION_MULTIPLE: return "MULTIPLE"; } return StringPrintf("%" PRId32, action); } static inline int32_t getMotionEventActionPointerIndex(int32_t action) { return (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; Loading Loading @@ -3976,11 +4006,11 @@ InputDispatcher::KeyEntry::~KeyEntry() { } void InputDispatcher::KeyEntry::appendDescription(std::string& msg) const { msg += StringPrintf("KeyEvent(deviceId=%d, source=0x%08x, action=%d, " msg += StringPrintf("KeyEvent(deviceId=%d, source=0x%08x, action=%s, " "flags=0x%08x, keyCode=%d, scanCode=%d, metaState=0x%08x, " "repeatCount=%d), policyFlags=0x%08x", deviceId, source, action, flags, keyCode, scanCode, metaState, repeatCount, policyFlags); deviceId, source, keyActionToString(action).c_str(), flags, keyCode, scanCode, metaState, repeatCount, policyFlags); } void InputDispatcher::KeyEntry::recycle() { Loading Loading @@ -4021,11 +4051,11 @@ InputDispatcher::MotionEntry::~MotionEntry() { } void InputDispatcher::MotionEntry::appendDescription(std::string& msg) const { msg += StringPrintf("MotionEvent(deviceId=%d, source=0x%08x, action=%d, actionButton=0x%08x, " msg += StringPrintf("MotionEvent(deviceId=%d, source=0x%08x, action=%s, actionButton=0x%08x, " "flags=0x%08x, metaState=0x%08x, buttonState=0x%08x, " "edgeFlags=0x%08x, xPrecision=%.1f, yPrecision=%.1f, displayId=%d, pointers=[", deviceId, source, action, actionButton, flags, metaState, buttonState, edgeFlags, xPrecision, yPrecision, displayId); deviceId, source, motionActionToString(action).c_str(), actionButton, flags, metaState, buttonState, edgeFlags, xPrecision, yPrecision, displayId); for (uint32_t i = 0; i < pointerCount; i++) { if (i) { msg += ", "; Loading services/surfaceflinger/Layer.cpp +1 −7 Original line number Diff line number Diff line Loading @@ -628,15 +628,9 @@ void Layer::setGeometry(const sp<const DisplayDevice>& displayDevice, uint32_t z transform = Transform(invTransform) * tr * bufferOrientation; } // STOPSHIP (b/72106793): If we have less than 25% scaling, HWC usually needs to use the rotator // to handle it. However, there is one guaranteed frame of jank when we switch to using the // rotator. In the meantime, we force GL composition instead until we have a better fix for the // HWC issue. bool extremeScaling = abs(t[0][0]) <= 0.25 || abs(t[1][1]) <= 0.25; // this gives us only the "orientation" component of the transform const uint32_t orientation = transform.getOrientation(); if (orientation & Transform::ROT_INVALID || extremeScaling) { if (orientation & Transform::ROT_INVALID) { // we can only handle simple transformation hwcInfo.forceClientComposition = true; } else { Loading services/surfaceflinger/SurfaceFlinger.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -3656,6 +3656,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw, ALOGE("Attempting to set unknown power mode: %d\n", mode); getHwComposer().setPowerMode(type, mode); } ALOGD("Finished set power mode=%d, type=%d", mode, hw->getDisplayType()); } void SurfaceFlinger::setPowerMode(const sp<IBinder>& display, int mode) { Loading Loading
libs/gui/SurfaceComposerClient.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -629,7 +629,7 @@ status_t SurfaceComposerClient::createSurfaceChecked( int32_t ownerUid) { sp<SurfaceControl> sur; status_t err = NO_ERROR; status_t err = mStatus; if (mStatus == NO_ERROR) { sp<IBinder> handle; Loading
libs/gui/tests/Surface_test.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ static constexpr uint64_t NO_FRAME_INDEX = std::numeric_limits<uint64_t>::max(); class SurfaceTest : public ::testing::Test { protected: SurfaceTest() { ProcessState::self()->startThreadPool(); } Loading Loading @@ -93,6 +92,16 @@ protected: sp<SurfaceControl> mSurfaceControl; }; TEST_F(SurfaceTest, CreateSurfaceReturnsErrorBadClient) { mComposerClient->dispose(); ASSERT_EQ(NO_INIT, mComposerClient->initCheck()); sp<SurfaceControl> sc; status_t err = mComposerClient->createSurfaceChecked( String8("Test Surface"), 32, 32, PIXEL_FORMAT_RGBA_8888, &sc, 0); ASSERT_EQ(NO_INIT, err); } TEST_F(SurfaceTest, QueuesToWindowComposerIsTrueWhenVisible) { sp<ANativeWindow> anw(mSurface); int result = -123; Loading
services/inputflinger/InputDispatcher.cpp +36 −6 Original line number Diff line number Diff line Loading @@ -105,6 +105,36 @@ static inline const char* toString(bool value) { return value ? "true" : "false"; } static std::string motionActionToString(int32_t action) { // Convert MotionEvent action to string switch(action & AMOTION_EVENT_ACTION_MASK) { case AMOTION_EVENT_ACTION_DOWN: return "DOWN"; case AMOTION_EVENT_ACTION_MOVE: return "MOVE"; case AMOTION_EVENT_ACTION_UP: return "UP"; case AMOTION_EVENT_ACTION_POINTER_DOWN: return "POINTER_DOWN"; case AMOTION_EVENT_ACTION_POINTER_UP: return "POINTER_UP"; } return StringPrintf("%" PRId32, action); } static std::string keyActionToString(int32_t action) { // Convert KeyEvent action to string switch(action) { case AKEY_EVENT_ACTION_DOWN: return "DOWN"; case AKEY_EVENT_ACTION_UP: return "UP"; case AKEY_EVENT_ACTION_MULTIPLE: return "MULTIPLE"; } return StringPrintf("%" PRId32, action); } static inline int32_t getMotionEventActionPointerIndex(int32_t action) { return (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; Loading Loading @@ -3976,11 +4006,11 @@ InputDispatcher::KeyEntry::~KeyEntry() { } void InputDispatcher::KeyEntry::appendDescription(std::string& msg) const { msg += StringPrintf("KeyEvent(deviceId=%d, source=0x%08x, action=%d, " msg += StringPrintf("KeyEvent(deviceId=%d, source=0x%08x, action=%s, " "flags=0x%08x, keyCode=%d, scanCode=%d, metaState=0x%08x, " "repeatCount=%d), policyFlags=0x%08x", deviceId, source, action, flags, keyCode, scanCode, metaState, repeatCount, policyFlags); deviceId, source, keyActionToString(action).c_str(), flags, keyCode, scanCode, metaState, repeatCount, policyFlags); } void InputDispatcher::KeyEntry::recycle() { Loading Loading @@ -4021,11 +4051,11 @@ InputDispatcher::MotionEntry::~MotionEntry() { } void InputDispatcher::MotionEntry::appendDescription(std::string& msg) const { msg += StringPrintf("MotionEvent(deviceId=%d, source=0x%08x, action=%d, actionButton=0x%08x, " msg += StringPrintf("MotionEvent(deviceId=%d, source=0x%08x, action=%s, actionButton=0x%08x, " "flags=0x%08x, metaState=0x%08x, buttonState=0x%08x, " "edgeFlags=0x%08x, xPrecision=%.1f, yPrecision=%.1f, displayId=%d, pointers=[", deviceId, source, action, actionButton, flags, metaState, buttonState, edgeFlags, xPrecision, yPrecision, displayId); deviceId, source, motionActionToString(action).c_str(), actionButton, flags, metaState, buttonState, edgeFlags, xPrecision, yPrecision, displayId); for (uint32_t i = 0; i < pointerCount; i++) { if (i) { msg += ", "; Loading
services/surfaceflinger/Layer.cpp +1 −7 Original line number Diff line number Diff line Loading @@ -628,15 +628,9 @@ void Layer::setGeometry(const sp<const DisplayDevice>& displayDevice, uint32_t z transform = Transform(invTransform) * tr * bufferOrientation; } // STOPSHIP (b/72106793): If we have less than 25% scaling, HWC usually needs to use the rotator // to handle it. However, there is one guaranteed frame of jank when we switch to using the // rotator. In the meantime, we force GL composition instead until we have a better fix for the // HWC issue. bool extremeScaling = abs(t[0][0]) <= 0.25 || abs(t[1][1]) <= 0.25; // this gives us only the "orientation" component of the transform const uint32_t orientation = transform.getOrientation(); if (orientation & Transform::ROT_INVALID || extremeScaling) { if (orientation & Transform::ROT_INVALID) { // we can only handle simple transformation hwcInfo.forceClientComposition = true; } else { Loading
services/surfaceflinger/SurfaceFlinger.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -3656,6 +3656,7 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw, ALOGE("Attempting to set unknown power mode: %d\n", mode); getHwComposer().setPowerMode(type, mode); } ALOGD("Finished set power mode=%d, type=%d", mode, hw->getDisplayType()); } void SurfaceFlinger::setPowerMode(const sp<IBinder>& display, int mode) { Loading