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

Conversation

@amirh
Copy link
Contributor

@amirh amirh commented Jan 5, 2018

Just always use SkPath.

This is a breaking change, framework PR: flutter/flutter#13942.
Will announce a breaking change before submitting.

@Hixie
Copy link
Contributor

Hixie commented Jan 5, 2018

When landing this on the framework please keep an eye on the performance numbers to make sure this doesn't cause any regressions. Thanks.

#endif // defined(OS_FUCHSIA)
private:
SkPath path_;
bool isRect_;
Copy link
Member

Choose a reason for hiding this comment

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

add a constructor initializer for isRect_

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

SkRRect rrect = SkRRect::MakeEmpty();
if (path.isRRect(&rrect)) {
frameRRect_ = rrect;
isRect_ = rrect.isRect();
Copy link
Member

Choose a reason for hiding this comment

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

I think we'll want the isRect check on all platforms so Paint() can avoid the canvas.saveLayer() call in the common case of a rectangular shape

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

}
#if defined(OS_FUCHSIA)
if (path.isRRect(&rrect)) {
frameRRect_ = rrect;
Copy link
Member

Choose a reason for hiding this comment

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

Now it looks like isRect_ will not be set to true in the Fuchsia case. I'd recommend moving this to physical_model_layer.cc and having one code path for all platforms that calls path.isRRect(&frameRRect_) and sets isRect_ accordingly

@amirh amirh force-pushed the physical-layer-path-only branch from ab1f977 to a6194d9 Compare January 5, 2018 23:24
@amirh
Copy link
Contributor Author

amirh commented Jan 5, 2018

PTAL, also renamed physical model to physical shape.

Copy link
Member

@jason-simmons jason-simmons left a comment

Choose a reason for hiding this comment

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

LGTM


PhysicalModelLayer::PhysicalModelLayer() {
isRect_ = false;
frameRRect_ = SkRRect::MakeEmpty();
Copy link
Member

Choose a reason for hiding this comment

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

No need to do this explicitly - SkRRect's default constructor will make it empty

@amirh amirh merged commit d8740c7 into flutter:master Jan 9, 2018
@amirh amirh deleted the physical-layer-path-only branch January 9, 2018 00:13
amirh added a commit to amirh/flutter that referenced this pull request Jan 9, 2018
This adjusts the framework to work with the engine change in flutter/engine#4519
amirh added a commit that referenced this pull request Jan 9, 2018
amirh added a commit that referenced this pull request Jan 9, 2018
amirh added a commit to amirh/engine that referenced this pull request Jan 11, 2018
…del layers. (flutter#4519)""

That commit was reverted due to a performance regression, which we've
root caused since. And going to followup with a fix.
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.

4 participants