Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented May 8, 2020

void drawLine(ui.Offset p1, ui.Offset p2, SurfacePaintData paint) {
_applyPaint(paint);
_canvasPool.strokeLine(p1, p2);
_withPaint(paint, () {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@yjbanov yjbanov force-pushed the safari-mask-filter branch from 8317167 to f6147f1 Compare May 16, 2020 19:17
@yjbanov yjbanov force-pushed the safari-mask-filter branch from f6147f1 to b76793c Compare May 16, 2020 19:18
@yjbanov yjbanov force-pushed the safari-mask-filter branch from c2306be to 13bc108 Compare May 16, 2020 22:42
@yjbanov yjbanov marked this pull request as ready for review May 16, 2020 22:43
@auto-assign auto-assign bot requested a review from iskakaushik May 16, 2020 22:45
return scaled(arg);
}
if (arg is Vector3) {
return transformed3(arg);
Copy link
Contributor

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?

Copy link
Contributor Author

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() {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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();
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@yjbanov yjbanov requested a review from ferhatb May 18, 2020 16:46
@yjbanov
Copy link
Contributor Author

yjbanov commented May 18, 2020

Mac iOS Engine failure is unrelated. Merging.

@yjbanov yjbanov merged commit 03b5f2c into flutter:master May 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2020
wandyers pushed a commit to wandyers/engine that referenced this pull request May 23, 2020
* implement MaskFilter.blur as shadow on Safari
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cupertino Slider shadows are too strong/harsh on the web

3 participants