-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display list R-Tree culling #38429
Display list R-Tree culling #38429
Conversation
217c86b
to
4fe453d
Compare
@endless7 does this solution answer your concerns about the correlation of ops to bounds in the R-Tree? |
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.
Fantastic! LGTM!
…117563) * 23582159a [web] Render in custom target (flutter/engine#37738) * 766f8fd91 Roll Fuchsia Mac SDK from UsYNZnnfR_s0OGQoX... to Xu_G6EQQ2UG48e5qI... (flutter/engine#38457) * 6f829b7e3 Roll Dart SDK from fc0a3217b39a to cb6245d8f8d3 (1 revision) (flutter/engine#38458) * 74d9ba455 Roll Skia from f1610a251e3a to 67904a365fdc (1 revision) (flutter/engine#38459) * 19de6262b Roll Skia from 67904a365fdc to c93fa176c9ca (6 revisions) (flutter/engine#38460) * 147ac7d02 Display list R-Tree culling (flutter/engine#38429) * 3549fb1ed Roll Skia from c93fa176c9ca to 33807a735c32 (3 revisions) (flutter/engine#38464) * d76ccb8f4 Roll Dart SDK from cb6245d8f8d3 to 47b0d07e6be9 (3 revisions) (flutter/engine#38465) * 2c9e1d98d Roll Skia from 33807a735c32 to 89742d768c97 (3 revisions) (flutter/engine#38467) * 3b115f033 Revert "[web] Render in custom target (#37738)" (flutter/engine#38469) * ca0c843bf Roll Fuchsia Mac SDK from Xu_G6EQQ2UG48e5qI... to W0GUdjHi4gI48optN... (flutter/engine#38468)
This PR shows a net gain in the builder benchmarks for the kRtree and kBoundsAndRtree sub-measurements: |
This reverts commit 147ac7d.
I got it. Thanks!! |
* collect DL indices in RTree for clip culling * fix bounds in unit test and minor opt in Dispatch * normalize inline matrix objects and minor fixes to unit test * remove over-eager DCHECK and improve R-Tree comments * formatting * include vector for Windows * method rename and distribute child nodes more evenly * add R-Tree specific unit tests and debug checks * add comments about geometry to R-Tree unit tests and adjust spacing * licenses * licenses attempt 2 * fix potential overflow with uint32_t * aggressively const DisplayList fields and methods * add implementation comments per review feedback
…lutter#117563) * 23582159a [web] Render in custom target (flutter/engine#37738) * 766f8fd91 Roll Fuchsia Mac SDK from UsYNZnnfR_s0OGQoX... to Xu_G6EQQ2UG48e5qI... (flutter/engine#38457) * 6f829b7e3 Roll Dart SDK from fc0a3217b39a to cb6245d8f8d3 (1 revision) (flutter/engine#38458) * 74d9ba455 Roll Skia from f1610a251e3a to 67904a365fdc (1 revision) (flutter/engine#38459) * 19de6262b Roll Skia from 67904a365fdc to c93fa176c9ca (6 revisions) (flutter/engine#38460) * 147ac7d02 Display list R-Tree culling (flutter/engine#38429) * 3549fb1ed Roll Skia from c93fa176c9ca to 33807a735c32 (3 revisions) (flutter/engine#38464) * d76ccb8f4 Roll Dart SDK from cb6245d8f8d3 to 47b0d07e6be9 (3 revisions) (flutter/engine#38465) * 2c9e1d98d Roll Skia from 33807a735c32 to 89742d768c97 (3 revisions) (flutter/engine#38467) * 3b115f033 Revert "[web] Render in custom target (flutter#37738)" (flutter/engine#38469) * ca0c843bf Roll Fuchsia Mac SDK from Xu_G6EQQ2UG48e5qI... to W0GUdjHi4gI48optN... (flutter/engine#38468)
…lutter#117563) * 23582159a [web] Render in custom target (flutter/engine#37738) * 766f8fd91 Roll Fuchsia Mac SDK from UsYNZnnfR_s0OGQoX... to Xu_G6EQQ2UG48e5qI... (flutter/engine#38457) * 6f829b7e3 Roll Dart SDK from fc0a3217b39a to cb6245d8f8d3 (1 revision) (flutter/engine#38458) * 74d9ba455 Roll Skia from f1610a251e3a to 67904a365fdc (1 revision) (flutter/engine#38459) * 19de6262b Roll Skia from 67904a365fdc to c93fa176c9ca (6 revisions) (flutter/engine#38460) * 147ac7d02 Display list R-Tree culling (flutter/engine#38429) * 3549fb1ed Roll Skia from c93fa176c9ca to 33807a735c32 (3 revisions) (flutter/engine#38464) * d76ccb8f4 Roll Dart SDK from cb6245d8f8d3 to 47b0d07e6be9 (3 revisions) (flutter/engine#38465) * 2c9e1d98d Roll Skia from 33807a735c32 to 89742d768c97 (3 revisions) (flutter/engine#38467) * 3b115f033 Revert "[web] Render in custom target (flutter#37738)" (flutter/engine#38469) * ca0c843bf Roll Fuchsia Mac SDK from Xu_G6EQQ2UG48e5qI... to W0GUdjHi4gI48optN... (flutter/engine#38468)
Fixes: flutter/flutter#92740
This PR uses an R-Tree (when computed by the Builder) to cull the dispatching of a DisplayList similar to what is done in SkPicture objects when constructed with a bbox factory.
Some additional changes:
Push
which means the rectangles need to be tagged withop_index_ - 1
. I eventually want to move the bounds calculations to before thePush
calls and then potentially use them to proactively cull operations that will never be visible due to clipping.The basic principle here is to add the "index" of every rendering op to the DisplayList R-Tree. At rendering time, if the DL is a super-set of the current clip bounds then an R-Tree search is done on those bounds and only the indicated rendering ops are executed. Also executed are all attribute ops, any saveLayer/restore enclosing a chosen rendering op, and any transform/clip operations that will be followed by a matched rendering op before their next restore.
Previous PR prototypes (now obsolete):