Loading libs/ui/Region.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -325,14 +325,14 @@ Region& Region::translateSelf(int x, int y) { return *this; } Region& Region::scaleSelf(int sx, int sy) { Region& Region::scaleSelf(float sx, float sy) { size_t count = mStorage.size(); Rect* rects = mStorage.editArray(); while (count) { rects->left *= sx; rects->right *= sx; rects->top *= sy; rects->bottom *= sy; rects->left = static_cast<int32_t>(rects->left * sx + 0.5f); rects->right = static_cast<int32_t>(rects->right * sx + 0.5f); rects->top = static_cast<int32_t>(rects->top * sy + 0.5f); rects->bottom = static_cast<int32_t>(rects->bottom * sy + 0.5f); rects++; count--; } Loading libs/ui/include/ui/Region.h +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ public: // these translate rhs first Region& translateSelf(int dx, int dy); Region& scaleSelf(int sx, int sy); Region& scaleSelf(float sx, float sy); Region& orSelf(const Region& rhs, int dx, int dy); Region& xorSelf(const Region& rhs, int dx, int dy); Region& andSelf(const Region& rhs, int dx, int dy); Loading services/inputflinger/InputDispatcher.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -3518,7 +3518,7 @@ void InputDispatcher::dumpDispatchStateLocked(std::string& dump) { dump += StringPrintf(INDENT3 "%zu: name='%s', displayId=%d, " "paused=%s, hasFocus=%s, hasWallpaper=%s, " "visible=%s, canReceiveKeys=%s, flags=0x%08x, type=0x%08x, layer=%d, " "frame=[%d,%d][%d,%d], globalScale=%f, windowScale=%f,%f" "frame=[%d,%d][%d,%d], globalScale=%f, windowScale=(%f,%f), " "touchableRegion=", i, windowInfo->name.c_str(), windowInfo->displayId, toString(windowInfo->paused), Loading services/surfaceflinger/Layer.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -2118,10 +2118,13 @@ InputWindowInfo Layer::fillInputInfo(const Rect& screenBounds) { info.frameBottom = screenBounds.bottom - info.surfaceInset; ui::Transform t = getTransform(); info.windowXScale *= 1.0f / t.sx(); info.windowYScale *= 1.0f / t.sy(); info.touchableRegion.scaleSelf(t.sx(), t.sy()); const float xScale = t.sx(); const float yScale = t.sy(); if (xScale != 1.0f || yScale != 1.0f) { info.windowXScale *= 1.0f / xScale; info.windowYScale *= 1.0f / yScale; info.touchableRegion.scaleSelf(xScale, yScale); } info.touchableRegion = info.touchableRegion.translate( screenBounds.left, Loading Loading
libs/ui/Region.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -325,14 +325,14 @@ Region& Region::translateSelf(int x, int y) { return *this; } Region& Region::scaleSelf(int sx, int sy) { Region& Region::scaleSelf(float sx, float sy) { size_t count = mStorage.size(); Rect* rects = mStorage.editArray(); while (count) { rects->left *= sx; rects->right *= sx; rects->top *= sy; rects->bottom *= sy; rects->left = static_cast<int32_t>(rects->left * sx + 0.5f); rects->right = static_cast<int32_t>(rects->right * sx + 0.5f); rects->top = static_cast<int32_t>(rects->top * sy + 0.5f); rects->bottom = static_cast<int32_t>(rects->bottom * sy + 0.5f); rects++; count--; } Loading
libs/ui/include/ui/Region.h +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ public: // these translate rhs first Region& translateSelf(int dx, int dy); Region& scaleSelf(int sx, int sy); Region& scaleSelf(float sx, float sy); Region& orSelf(const Region& rhs, int dx, int dy); Region& xorSelf(const Region& rhs, int dx, int dy); Region& andSelf(const Region& rhs, int dx, int dy); Loading
services/inputflinger/InputDispatcher.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -3518,7 +3518,7 @@ void InputDispatcher::dumpDispatchStateLocked(std::string& dump) { dump += StringPrintf(INDENT3 "%zu: name='%s', displayId=%d, " "paused=%s, hasFocus=%s, hasWallpaper=%s, " "visible=%s, canReceiveKeys=%s, flags=0x%08x, type=0x%08x, layer=%d, " "frame=[%d,%d][%d,%d], globalScale=%f, windowScale=%f,%f" "frame=[%d,%d][%d,%d], globalScale=%f, windowScale=(%f,%f), " "touchableRegion=", i, windowInfo->name.c_str(), windowInfo->displayId, toString(windowInfo->paused), Loading
services/surfaceflinger/Layer.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -2118,10 +2118,13 @@ InputWindowInfo Layer::fillInputInfo(const Rect& screenBounds) { info.frameBottom = screenBounds.bottom - info.surfaceInset; ui::Transform t = getTransform(); info.windowXScale *= 1.0f / t.sx(); info.windowYScale *= 1.0f / t.sy(); info.touchableRegion.scaleSelf(t.sx(), t.sy()); const float xScale = t.sx(); const float yScale = t.sy(); if (xScale != 1.0f || yScale != 1.0f) { info.windowXScale *= 1.0f / xScale; info.windowYScale *= 1.0f / yScale; info.touchableRegion.scaleSelf(xScale, yScale); } info.touchableRegion = info.touchableRegion.translate( screenBounds.left, Loading