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

Conversation

@liyuqian
Copy link
Contributor

To catch issues like flutter/flutter#30586

We'll also upload a test in the framework that will trigger this DCHECK
if #8467 were reverted.

To catch issues like flutter/flutter#30586

We'll also upload a test in the framework that will trigger this DCHECK
if flutter#8467 were reverted.
TransformLayer::~TransformLayer() = default;

void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
// Checks (in some degree) that SkMatrix transform_ is valid and initialized.
Copy link
Member

Choose a reason for hiding this comment

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

Can the TransformLayer constructor initialize the transform_ to the identity matrix?

Another option would be setting a flag when set_transform is called and checking that flag here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a flag, together with this isFinite check. The reason that we still need this isFinite check is that someone could call set_transform with an uninitialized SkMatrix.

//
// We have to write this flaky test because there is no reliable way to test
// whether a variable is initialized or not in C++.
FML_DCHECK(transform_.isFinite());
Copy link
Member

Choose a reason for hiding this comment

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

The unopt variant is not used in any serious manner when exercising flow. Having uninitialized stuff in the matrix is quite serious. Maybe just terminate the process here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed FML_DCHECK to FML_CHECK.

@liyuqian liyuqian force-pushed the check_transform_matrix branch from 085d11f to c1caefd Compare April 16, 2019 00:29
@liyuqian
Copy link
Contributor Author

@chinmaygarde @jason-simmons : how does the new patch look to you?

@chinmaygarde
Copy link
Member

Instead of the is_set_ flag, IMO, it would be cleaner to initialize the matrix to identity in the constructor but still do the isFinite check.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

lgtm with the nit about initializing the matrix.

@liyuqian liyuqian force-pushed the check_transform_matrix branch from 741cfff to c592f71 Compare April 17, 2019 00:31
@liyuqian liyuqian merged commit 3b01610 into flutter:master Apr 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 17, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Apr 17, 2019
flutter/engine@388124f...fdd4272

git log 388124f..fdd4272 --no-merges --oneline
fdd4272 Roll src/third_party/skia 70ed05e53ad2..652b007a4cbb (1 commits) (flutter/engine#8601)
3b01610 Check that TransformLayer has a finite matrix (flutter/engine#8585)
4805d72 Implement StandardMethodCodec for C++ shells (flutter/engine#8598)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
liyuqian added a commit to liyuqian/flutter that referenced this pull request Apr 18, 2019
As we've introduced offset to the Opacity layer, we have to override
`applyTransform` to make Leader/FollowerLayer work correctly.

Fixes flutter#30587

Together with flutter/engine#8585,
this test will also exercise test against
flutter#30586.
liyuqian added a commit to flutter/flutter that referenced this pull request Apr 29, 2019
## Description

As we've introduced offset to the Opacity layer, we have to override
`applyTransform` to make Leader/FollowerLayer work correctly.

## Related Issues

Fixes #30587

Together with flutter/engine#8585,
this test will also exercise test against
#30586.

## Tests

I added the following tests:
* text field selection toolbar renders correctly inside opacity
@liyuqian liyuqian deleted the check_transform_matrix branch May 23, 2019 18:47
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