-
Notifications
You must be signed in to change notification settings - Fork 6k
implement MaskFilter.blur as shadow on Safari #18216
Conversation
void drawLine(ui.Offset p1, ui.Offset p2, SurfacePaintData paint) { | ||
_applyPaint(paint); | ||
_canvasPool.strokeLine(p1, p2); | ||
_withPaint(paint, () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will likely allocate a new class instance for each call due to closure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Changed it to _setUpPaint
/_tearDownPaint
methods.
8317167
to
f6147f1
Compare
f6147f1
to
b76793c
Compare
c2306be
to
13bc108
Compare
return scaled(arg); | ||
} | ||
if (arg is Vector3) { | ||
return transformed3(arg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aim was to to reduce allocation/copy, why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyless version is transform3
. I removed transformed3
, which was making copies. I wasn't sure if operator *
is still used, so I'm not changing it yet.
/// commands prior to painting do not need to be cleared. | ||
/// | ||
/// Must be called after calling [setUpPaint]. | ||
void tearDownPaint() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this get removed dart2js release? Maybe place all tearDownPaint() calls inside asserts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be removed. Otherwise the context won't be restored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. likely very small will be inlined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if we had access to dart2js inlining annotations.
if (requiresClipping) { | ||
restore(); | ||
} | ||
_closeCurrentCanvas(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead you could remove _closeCurrentCanvas on line 446 in if clause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm actually not sure what this change is about. Must have been a bad merge 🤔
Let me check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, this was a drive-by change to avoid double-closing. Yes, I will remove the other one. Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Mac iOS Engine failure is unrelated. Merging. |
* implement MaskFilter.blur as shadow on Safari
Fixes flutter/flutter#55930
Requires flutter/goldens#96