Loading services/surfaceflinger/Layer.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -293,8 +293,10 @@ static FloatRect reduce(const FloatRect& win, const Region& exclude) { return Region(Rect{win}).subtract(exclude).getBounds().toFloatRect(); } Rect Layer::computeScreenBounds() const { FloatRect bounds = computeBounds(); Rect Layer::computeScreenBounds(bool reduceTransparentRegion) const { const State& s(getDrawingState()); Region transparentRegion = reduceTransparentRegion ? getActiveTransparentRegion(s) : Region(); FloatRect bounds = computeBounds(transparentRegion); ui::Transform t = getTransform(); // Transform to screen space. bounds = t.transform(bounds); Loading Loading @@ -2155,7 +2157,6 @@ InputWindowInfo Layer::fillInputInfo(const Rect& screenBounds) { // Position the touchable region relative to frame screen location and restrict it to frame // bounds. info.touchableRegion = info.touchableRegion.translate(info.frameLeft, info.frameTop); info.touchableRegion = info.touchableRegion.intersect(frame); info.visible = isVisible(); return info; } Loading services/surfaceflinger/Layer.h +1 −1 Original line number Diff line number Diff line Loading @@ -617,7 +617,7 @@ public: ssize_t removeChild(const sp<Layer>& layer); sp<Layer> getParent() const { return mCurrentParent.promote(); } bool hasParent() const { return getParent() != nullptr; } Rect computeScreenBounds() const; Rect computeScreenBounds(bool reduceTransparentRegion = true) const; bool setChildLayer(const sp<Layer>& childLayer, int32_t z); bool setChildRelativeLayer(const sp<Layer>& childLayer, const sp<IBinder>& relativeToHandle, int32_t relativeZ); Loading services/surfaceflinger/SurfaceFlinger.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -2767,7 +2767,10 @@ void SurfaceFlinger::updateInputWindows() { mDrawingState.traverseInReverseZOrder([&](Layer* layer) { if (layer->hasInput()) { inputHandles.add(layer->fillInputInfo(layer->computeScreenBounds())); // When calculating the screen bounds we ignore the transparent region since it may // result in an unwanted offset. inputHandles.add(layer->fillInputInfo( layer->computeScreenBounds(false /* reduceTransparentRegion */))); } }); mInputFlinger->setInputWindows(inputHandles); Loading Loading
services/surfaceflinger/Layer.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -293,8 +293,10 @@ static FloatRect reduce(const FloatRect& win, const Region& exclude) { return Region(Rect{win}).subtract(exclude).getBounds().toFloatRect(); } Rect Layer::computeScreenBounds() const { FloatRect bounds = computeBounds(); Rect Layer::computeScreenBounds(bool reduceTransparentRegion) const { const State& s(getDrawingState()); Region transparentRegion = reduceTransparentRegion ? getActiveTransparentRegion(s) : Region(); FloatRect bounds = computeBounds(transparentRegion); ui::Transform t = getTransform(); // Transform to screen space. bounds = t.transform(bounds); Loading Loading @@ -2155,7 +2157,6 @@ InputWindowInfo Layer::fillInputInfo(const Rect& screenBounds) { // Position the touchable region relative to frame screen location and restrict it to frame // bounds. info.touchableRegion = info.touchableRegion.translate(info.frameLeft, info.frameTop); info.touchableRegion = info.touchableRegion.intersect(frame); info.visible = isVisible(); return info; } Loading
services/surfaceflinger/Layer.h +1 −1 Original line number Diff line number Diff line Loading @@ -617,7 +617,7 @@ public: ssize_t removeChild(const sp<Layer>& layer); sp<Layer> getParent() const { return mCurrentParent.promote(); } bool hasParent() const { return getParent() != nullptr; } Rect computeScreenBounds() const; Rect computeScreenBounds(bool reduceTransparentRegion = true) const; bool setChildLayer(const sp<Layer>& childLayer, int32_t z); bool setChildRelativeLayer(const sp<Layer>& childLayer, const sp<IBinder>& relativeToHandle, int32_t relativeZ); Loading
services/surfaceflinger/SurfaceFlinger.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -2767,7 +2767,10 @@ void SurfaceFlinger::updateInputWindows() { mDrawingState.traverseInReverseZOrder([&](Layer* layer) { if (layer->hasInput()) { inputHandles.add(layer->fillInputInfo(layer->computeScreenBounds())); // When calculating the screen bounds we ignore the transparent region since it may // result in an unwanted offset. inputHandles.add(layer->fillInputInfo( layer->computeScreenBounds(false /* reduceTransparentRegion */))); } }); mInputFlinger->setInputWindows(inputHandles); Loading