#19225 closed defect (fixed)
[PATCH] MapRendererPerformanceTest does not render as intended anymore
Reported by: | johsin18 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.06 |
Component: | Unit tests | Version: | latest |
Keywords: | Cc: |
Description (last modified by )
MapRendererPerformanceTest.testPerformanceDrawFeatures has two major problems (as of revision 16390).
- Lines are not drawn at all.
- The code tries to draw multiple variants, one with all features, one with just icons, one with just lines, and so on. However, currently, all variants results in the same output (namely having all features, except for the lines, as stated above).
- Overall, it draws as depicted in screenshot
I provide not status report as I have found clear bugs in the code already.
Attachments (4)
Change History (11)
by , 5 years ago
Attachment: | testPerformanceDrawFeatures-buggy.png added |
---|
by , 5 years ago
Attachment: | test-neubrandenburg-all.png added |
---|
comment:1 by , 5 years ago
The problems are caused by two things.
The map paint cache is not invalidated after switching the styles, so all variants are drawn like the first one (with all features).
viewWidth and viewHeight of MapViewState stay 0, so all lines are clipped.
The attached patch fixes those problems. However, the patch for the second problem is quite intrusive (overriding setBounds), so there might be better ways of doing it.
In addition, some minor issues are fixed as well.
See the changes commit by commit here:
https://github.com/johsin18/josm/commits/fix-MapRendererPerformanceTest
As the map segment is different now (centered on downtown, seems more reasonable), and all features are actually drawn, the timings are up to 3 times slower.
The resulting images are (all features)
and for example (just icons)
by , 5 years ago
Attachment: | fix-MapRendererPerformanceTest.patch added |
---|
comment:2 by , 5 years ago
I have made the patch less intrusive. It does not touch any appliation code anymore, just test code. So it should be very safe to merge it in.
I found the working approach in AbstractMapRendererPerformanceTestParent, which raises the questions whether StyledMapRendererPerformanceTest has superseded MapRendererPerformanceTest (at least MapRendererPerformanceTest.testPerformanceDrawFeatures). Then, the later should maybe be removed instead of fixed.
@simon04 Could you have a look maybe?
Some commits just improve the measurement accuracy, you can leave them out if you don't like them.
https://github.com/johsin18/josm/commits/fix-MapRendererPerformanceTest
comment:3 by , 5 years ago
Description: | modified (diff) |
---|
comment:6 by , 5 years ago
Component: | Core mappaint → Unit tests |
---|
all features after fix