Loading libs/gui/WindowInfo.cpp +8 −17 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ bool WindowInfo::touchableRegionContainsPoint(int32_t x, int32_t y) const { } bool WindowInfo::frameContainsPoint(int32_t x, int32_t y) const { return x >= frameLeft && x < frameRight && y >= frameTop && y < frameBottom; return x >= frame.left && x < frame.right && y >= frame.top && y < frame.bottom; } bool WindowInfo::supportsSplitTouch() const { Loading @@ -59,18 +59,15 @@ bool WindowInfo::interceptsStylus() const { } bool WindowInfo::overlaps(const WindowInfo* other) const { const bool nonEmpty = (frameRight - frameLeft > 0) || (frameBottom - frameTop > 0); return nonEmpty && frameLeft < other->frameRight && frameRight > other->frameLeft && frameTop < other->frameBottom && frameBottom > other->frameTop; return !frame.isEmpty() && frame.left < other->frame.right && frame.right > other->frame.left && frame.top < other->frame.bottom && frame.bottom > other->frame.top; } bool WindowInfo::operator==(const WindowInfo& info) const { return info.token == token && info.id == id && info.name == name && info.dispatchingTimeout == dispatchingTimeout && info.frameLeft == frameLeft && info.frameTop == frameTop && info.frameRight == frameRight && info.frameBottom == frameBottom && info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor && info.transform == transform && info.touchableRegion.hasSameRects(touchableRegion) && info.dispatchingTimeout == dispatchingTimeout && info.frame == frame && info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor && info.transform == transform && info.touchableRegion.hasSameRects(touchableRegion) && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && info.inputConfig == inputConfig && info.displayId == displayId && Loading Loading @@ -103,10 +100,7 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(layoutParamsFlags.get()) ?: parcel->writeInt32( static_cast<std::underlying_type_t<WindowInfo::Type>>(layoutParamsType)) ?: parcel->writeInt32(frameLeft) ?: parcel->writeInt32(frameTop) ?: parcel->writeInt32(frameRight) ?: parcel->writeInt32(frameBottom) ?: parcel->write(frame) ?: parcel->writeInt32(surfaceInset) ?: parcel->writeFloat(globalScaleFactor) ?: parcel->writeFloat(alpha) ?: Loading Loading @@ -155,10 +149,7 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { // clang-format off status = parcel->readInt32(&lpFlags) ?: parcel->readInt32(&lpType) ?: parcel->readInt32(&frameLeft) ?: parcel->readInt32(&frameTop) ?: parcel->readInt32(&frameRight) ?: parcel->readInt32(&frameBottom) ?: parcel->read(frame) ?: parcel->readInt32(&surfaceInset) ?: parcel->readFloat(&globalScaleFactor) ?: parcel->readFloat(&alpha) ?: Loading libs/gui/fuzzer/libgui_surfaceComposerClient_fuzzer.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -178,10 +178,8 @@ void SurfaceComposerClientFuzzer::getWindowInfo(gui::WindowInfo* windowInfo) { windowInfo->name = mFdp.ConsumeRandomLengthString(kRandomStringMaxBytes); windowInfo->layoutParamsFlags = mFdp.PickValueInArray(kFlags); windowInfo->layoutParamsType = mFdp.PickValueInArray(kType); windowInfo->frameLeft = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frameTop = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frameRight = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frameBottom = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frame = Rect(mFdp.ConsumeIntegral<int32_t>(), mFdp.ConsumeIntegral<int32_t>(), mFdp.ConsumeIntegral<int32_t>(), mFdp.ConsumeIntegral<int32_t>()); windowInfo->surfaceInset = mFdp.ConsumeIntegral<int32_t>(); windowInfo->alpha = mFdp.ConsumeFloatingPointInRange<float>(0, 1); ui::Transform transform(mFdp.PickValueInArray(kOrientation)); Loading libs/gui/include/gui/WindowInfo.h +1 −4 Original line number Diff line number Diff line Loading @@ -194,10 +194,7 @@ struct WindowInfo : public Parcelable { std::chrono::nanoseconds dispatchingTimeout = std::chrono::seconds(5); /* These values are filled in by SurfaceFlinger. */ int32_t frameLeft = -1; int32_t frameTop = -1; int32_t frameRight = -1; int32_t frameBottom = -1; Rect frame = Rect::INVALID_RECT; /* * SurfaceFlinger consumes this value to shrink the computed frame. This is Loading libs/gui/tests/WindowInfo_test.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -52,10 +52,7 @@ TEST(WindowInfo, Parcelling) { i.layoutParamsFlags = WindowInfo::Flag::SLIPPERY; i.layoutParamsType = WindowInfo::Type::INPUT_METHOD; i.dispatchingTimeout = 12s; i.frameLeft = 93; i.frameTop = 34; i.frameRight = 16; i.frameBottom = 19; i.frame = Rect(93, 34, 16, 19); i.surfaceInset = 17; i.globalScaleFactor = 0.3; i.alpha = 0.7; Loading Loading @@ -85,10 +82,7 @@ TEST(WindowInfo, Parcelling) { ASSERT_EQ(i.layoutParamsFlags, i2.layoutParamsFlags); ASSERT_EQ(i.layoutParamsType, i2.layoutParamsType); ASSERT_EQ(i.dispatchingTimeout, i2.dispatchingTimeout); ASSERT_EQ(i.frameLeft, i2.frameLeft); ASSERT_EQ(i.frameTop, i2.frameTop); ASSERT_EQ(i.frameRight, i2.frameRight); ASSERT_EQ(i.frameBottom, i2.frameBottom); ASSERT_EQ(i.frame, i2.frame); ASSERT_EQ(i.surfaceInset, i2.surfaceInset); ASSERT_EQ(i.globalScaleFactor, i2.globalScaleFactor); ASSERT_EQ(i.alpha, i2.alpha); Loading services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -185,10 +185,7 @@ public: mInfo.token = mClientChannel->getConnectionToken(); mInfo.name = "FakeWindowHandle"; mInfo.dispatchingTimeout = DISPATCHING_TIMEOUT; mInfo.frameLeft = mFrame.left; mInfo.frameTop = mFrame.top; mInfo.frameRight = mFrame.right; mInfo.frameBottom = mFrame.bottom; mInfo.frame = mFrame; mInfo.globalScaleFactor = 1.0; mInfo.touchableRegion.clear(); mInfo.addTouchableRegion(mFrame); Loading Loading
libs/gui/WindowInfo.cpp +8 −17 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ bool WindowInfo::touchableRegionContainsPoint(int32_t x, int32_t y) const { } bool WindowInfo::frameContainsPoint(int32_t x, int32_t y) const { return x >= frameLeft && x < frameRight && y >= frameTop && y < frameBottom; return x >= frame.left && x < frame.right && y >= frame.top && y < frame.bottom; } bool WindowInfo::supportsSplitTouch() const { Loading @@ -59,18 +59,15 @@ bool WindowInfo::interceptsStylus() const { } bool WindowInfo::overlaps(const WindowInfo* other) const { const bool nonEmpty = (frameRight - frameLeft > 0) || (frameBottom - frameTop > 0); return nonEmpty && frameLeft < other->frameRight && frameRight > other->frameLeft && frameTop < other->frameBottom && frameBottom > other->frameTop; return !frame.isEmpty() && frame.left < other->frame.right && frame.right > other->frame.left && frame.top < other->frame.bottom && frame.bottom > other->frame.top; } bool WindowInfo::operator==(const WindowInfo& info) const { return info.token == token && info.id == id && info.name == name && info.dispatchingTimeout == dispatchingTimeout && info.frameLeft == frameLeft && info.frameTop == frameTop && info.frameRight == frameRight && info.frameBottom == frameBottom && info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor && info.transform == transform && info.touchableRegion.hasSameRects(touchableRegion) && info.dispatchingTimeout == dispatchingTimeout && info.frame == frame && info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor && info.transform == transform && info.touchableRegion.hasSameRects(touchableRegion) && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && info.inputConfig == inputConfig && info.displayId == displayId && Loading Loading @@ -103,10 +100,7 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(layoutParamsFlags.get()) ?: parcel->writeInt32( static_cast<std::underlying_type_t<WindowInfo::Type>>(layoutParamsType)) ?: parcel->writeInt32(frameLeft) ?: parcel->writeInt32(frameTop) ?: parcel->writeInt32(frameRight) ?: parcel->writeInt32(frameBottom) ?: parcel->write(frame) ?: parcel->writeInt32(surfaceInset) ?: parcel->writeFloat(globalScaleFactor) ?: parcel->writeFloat(alpha) ?: Loading Loading @@ -155,10 +149,7 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { // clang-format off status = parcel->readInt32(&lpFlags) ?: parcel->readInt32(&lpType) ?: parcel->readInt32(&frameLeft) ?: parcel->readInt32(&frameTop) ?: parcel->readInt32(&frameRight) ?: parcel->readInt32(&frameBottom) ?: parcel->read(frame) ?: parcel->readInt32(&surfaceInset) ?: parcel->readFloat(&globalScaleFactor) ?: parcel->readFloat(&alpha) ?: Loading
libs/gui/fuzzer/libgui_surfaceComposerClient_fuzzer.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -178,10 +178,8 @@ void SurfaceComposerClientFuzzer::getWindowInfo(gui::WindowInfo* windowInfo) { windowInfo->name = mFdp.ConsumeRandomLengthString(kRandomStringMaxBytes); windowInfo->layoutParamsFlags = mFdp.PickValueInArray(kFlags); windowInfo->layoutParamsType = mFdp.PickValueInArray(kType); windowInfo->frameLeft = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frameTop = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frameRight = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frameBottom = mFdp.ConsumeIntegral<int32_t>(); windowInfo->frame = Rect(mFdp.ConsumeIntegral<int32_t>(), mFdp.ConsumeIntegral<int32_t>(), mFdp.ConsumeIntegral<int32_t>(), mFdp.ConsumeIntegral<int32_t>()); windowInfo->surfaceInset = mFdp.ConsumeIntegral<int32_t>(); windowInfo->alpha = mFdp.ConsumeFloatingPointInRange<float>(0, 1); ui::Transform transform(mFdp.PickValueInArray(kOrientation)); Loading
libs/gui/include/gui/WindowInfo.h +1 −4 Original line number Diff line number Diff line Loading @@ -194,10 +194,7 @@ struct WindowInfo : public Parcelable { std::chrono::nanoseconds dispatchingTimeout = std::chrono::seconds(5); /* These values are filled in by SurfaceFlinger. */ int32_t frameLeft = -1; int32_t frameTop = -1; int32_t frameRight = -1; int32_t frameBottom = -1; Rect frame = Rect::INVALID_RECT; /* * SurfaceFlinger consumes this value to shrink the computed frame. This is Loading
libs/gui/tests/WindowInfo_test.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -52,10 +52,7 @@ TEST(WindowInfo, Parcelling) { i.layoutParamsFlags = WindowInfo::Flag::SLIPPERY; i.layoutParamsType = WindowInfo::Type::INPUT_METHOD; i.dispatchingTimeout = 12s; i.frameLeft = 93; i.frameTop = 34; i.frameRight = 16; i.frameBottom = 19; i.frame = Rect(93, 34, 16, 19); i.surfaceInset = 17; i.globalScaleFactor = 0.3; i.alpha = 0.7; Loading Loading @@ -85,10 +82,7 @@ TEST(WindowInfo, Parcelling) { ASSERT_EQ(i.layoutParamsFlags, i2.layoutParamsFlags); ASSERT_EQ(i.layoutParamsType, i2.layoutParamsType); ASSERT_EQ(i.dispatchingTimeout, i2.dispatchingTimeout); ASSERT_EQ(i.frameLeft, i2.frameLeft); ASSERT_EQ(i.frameTop, i2.frameTop); ASSERT_EQ(i.frameRight, i2.frameRight); ASSERT_EQ(i.frameBottom, i2.frameBottom); ASSERT_EQ(i.frame, i2.frame); ASSERT_EQ(i.surfaceInset, i2.surfaceInset); ASSERT_EQ(i.globalScaleFactor, i2.globalScaleFactor); ASSERT_EQ(i.alpha, i2.alpha); Loading
services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -185,10 +185,7 @@ public: mInfo.token = mClientChannel->getConnectionToken(); mInfo.name = "FakeWindowHandle"; mInfo.dispatchingTimeout = DISPATCHING_TIMEOUT; mInfo.frameLeft = mFrame.left; mInfo.frameTop = mFrame.top; mInfo.frameRight = mFrame.right; mInfo.frameBottom = mFrame.bottom; mInfo.frame = mFrame; mInfo.globalScaleFactor = 1.0; mInfo.touchableRegion.clear(); mInfo.addTouchableRegion(mFrame); Loading