From 6f6611359cad20b3ac3178961e128b473291cf5b Mon Sep 17 00:00:00 2001 From: Jim Graham Date: Fri, 2 Jun 2023 15:03:07 -0700 Subject: [PATCH] Reland "Remove obsolete drawShadow bounds workaround (#127052)" (#127231) 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 19dbc89051..a089fbe145 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -1999,7 +1999,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(() { @@ -2020,14 +2019,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,