Unverified Commit 8089a309 authored by Jim Graham's avatar Jim Graham Committed by GitHub

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
parent 718f444b
...@@ -2017,7 +2017,6 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> { ...@@ -2017,7 +2017,6 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> {
_updateClip(); _updateClip();
final RRect offsetRRect = _clip!.shift(offset); final RRect offsetRRect = _clip!.shift(offset);
final Rect offsetBounds = offsetRRect.outerRect;
final Path offsetRRectAsPath = Path()..addRRect(offsetRRect); final Path offsetRRectAsPath = Path()..addRRect(offsetRRect);
bool paintShadows = true; bool paintShadows = true;
assert(() { assert(() {
...@@ -2038,14 +2037,6 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> { ...@@ -2038,14 +2037,6 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> {
final Canvas canvas = context.canvas; final Canvas canvas = context.canvas;
if (elevation != 0.0 && paintShadows) { 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( canvas.drawShadow(
offsetRRectAsPath, offsetRRectAsPath,
shadowColor, shadowColor,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment