Verbose display list comparisons #32737
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As we move towards having our layers speak to DisplayList objects directly, we might need to shift the way that we write layer unittests from the "vector of drawing records" that is driven by implementing SkCanvas to a new mechanism that compares DisplayList objects.
This PR will add a (pair of) mechanisms to do Verbose DisplayList comparisons to the MockLayer system. To use it, you hand the display_list version of the paint_context to a Layer's Paint() method and then manually construct a DisplayList that represents what should have been drawn (the
expected_display_list
). Then handing the MockLayer's display list and the expected version to DisplayListsEQ_Verbose (or the NE variant) and the two rendering paths will be compared operation by operation and if they don't match, a hierarchically pretty-printed version of the DisplayList will be written out alongside the error report so you can see what was different between the expectation and the layer's rendering.Along with the new mechanism a layer unittest was modified to demonstrate the new pattern. You can see the changes in opacity_layer_unittests.cc. Here is an example of the error output if I omit one of the setColor() commands to show how debugging will work under the new system:
Open to see sample test failure output