From 8089a309a937d6b3a6e66cb4c7c2e46b1b2959f3 Mon Sep 17 00:00:00 2001 From: Jim Graham Date: Wed, 17 May 2023 17:17:33 -0700 Subject: [PATCH] Remove obsolete drawShadow bounds workaround (#127052) This workaround was created 6 years ago with no links to bug databases to track. As best we can determine, the issue is no longer present in SkPicture or DisplayList and is most likely obsolete. More importantly, though, non-rendering primitives are ignored by the DisplayList construction and so this workaround will just be ignored anyway. If a problem surfaces about this issue that we haven't discovered by a thorough code search of the current code base, then workarounds should be installed within the relevant implementation modules rather than in the framework (and documented with bugs filed in either or both of Flutter's github repos, and/or the Skia issue database). Workaround originally created in this PR: https://github.com/flutter/flutter/pull/9654 --- packages/flutter/lib/src/rendering/proxy_box.dart | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index bdc906be0e..8c51850212 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -2017,7 +2017,6 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase { _updateClip(); final RRect offsetRRect = _clip!.shift(offset); - final Rect offsetBounds = offsetRRect.outerRect; final Path offsetRRectAsPath = Path()..addRRect(offsetRRect); bool paintShadows = true; assert(() { @@ -2038,14 +2037,6 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase { final Canvas canvas = context.canvas; if (elevation != 0.0 && paintShadows) { - // The drawShadow call doesn't add the region of the shadow to the - // picture's bounds, so we draw a hardcoded amount of extra space to - // account for the maximum potential area of the shadow. - // TODO(jsimmons): remove this when Skia does it for us. - canvas.drawRect( - offsetBounds.inflate(20.0), - _transparentPaint, - ); canvas.drawShadow( offsetRRectAsPath, shadowColor,