-
Notifications
You must be signed in to change notification settings - Fork 6k
Add GetBoundingRectAfterMutations to EmbeddedViewParams to calculate the final bounding rect for platform view
#19170
Conversation
flow/embedded_views.h
Outdated
| // https://github.com/flutter/flutter/issues/59821 | ||
| SkRect GetBoundingRectAfterMutations() const { | ||
| SkPath path; | ||
| SkRect starting_rect = SkRect::MakeSize(sizePoints); |
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 it still need the offsetPixels?
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.
I think mutator stack should contain all the offset informations already, By querying through the stack, we have the final offset
|
@blasten updated with our offline discussion |
flow/embedded_views.h
Outdated
| const SkPoint& offsetPixels() const { return offset_pixels_; }; | ||
| const SkSize& sizePoints() const { return size_points_; }; | ||
| const MutatorsStack& mutatorsStack() const { return mutators_stack_; }; | ||
| const SkRect& finalBoundingRect() const { return final_bounding_rect_; } |
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.
nit: could we document these methods?
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
| params.offsetPixels.y(), // | ||
| params.sizePoints.width() * device_pixel_ratio_, // | ||
| params.sizePoints.height() * device_pixel_ratio_ // | ||
| SkRect::MakeXYWH(params.offsetPixels().x(), // |
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.
is this just finalBoundingRect() now?
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.
I think the size is not the same as the bounding rect. The size points are the original size before applying mutation.
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.
@chinmaygarde I thought params.sizePoints did not consider scaling and rotation at all? Does embedder free from scaling and rotation layers?
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.
I believe the embedder is supposed to apply the scaling and rotation themselves from the data present in the mutator stack to get the final width and height. I believe there is a test for this in the embedder unit-tests harness and this should be documented in the header.
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.
I meant this rect returned from this method does not include rotation and scaling. Want to make sure if the original size used here is intended.
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.
Yes. It is.
blasten
left a comment
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.
LGTM + confirmation from @chinmaygarde
…rams to calculate the final bounding rect for platform view (flutter#19170)" (flutter#19204)" This reverts commit 9cecc5f.
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter/engine#19170)
…calculate the final bounding rect for platform view (flutter#19170)" (flutter#19204) This reverts commit f5c315f.
…calculate the final bounding rect for platform view flutter#19170" (flutter#19212)
Description
Adds a method to calculate the final bounding rect of the platform view.
Clippings are currently ignored
Related Issues
flutter/flutter#59821
Tests
embedded_view_params_unittests.cc
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.