Changeset 4087 in josm for trunk/test


Ignore:
Timestamp:
2011-05-15T23:51:25+02:00 (9 years ago)
Author:
bastiK
Message:

PaintVisitor refactoring, includes hook for external MapRenderers (author: Gubaer)

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/mapcss/performance/PerformanceTest.groovy

    r4074 r4087  
    1212import org.openstreetmap.josm.data.Bounds
    1313import org.openstreetmap.josm.data.osm.DataSet
    14 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintVisitor
     14import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer
    1515import org.openstreetmap.josm.gui.MainApplication
    1616import org.openstreetmap.josm.gui.layer.OsmDataLayer
     
    116116        Graphics2D g = img.createGraphics()
    117117        g.setClip(0,0, mv.getWidth(), mv.getHeight())
    118         def visitor = new MapPaintVisitor()
     118        def visitor = new StyledMapRenderer()
    119119        visitor.setNavigatableComponent(Main.map.mapView)
    120120        visitor.setGraphics(g)
     
    122122        print "Rendering ..."
    123123        long time = timed {
    124             visitor.visitAll(ds, false, new Bounds(-90,-180,90,180))
     124            visitor.render(ds, false, new Bounds(-90,-180,90,180))
    125125        }
    126126        println "DONE"
  • trunk/test/performance/org/openstreetmap/josm/data/osm/MapPaintVisitorPerformanceTest.java

    r3350 r4087  
    1010import org.openstreetmap.josm.Main;
    1111import org.openstreetmap.josm.data.Bounds;
    12 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintVisitor;
    13 import org.openstreetmap.josm.data.osm.visitor.paint.PaintVisitor;
     12import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
     13import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
    1414import org.openstreetmap.josm.data.projection.Mercator;
    1515import org.openstreetmap.josm.gui.NavigatableComponent;
     
    5252
    5353    private static void test(int iterations, DataSet ds, Bounds bounds) throws Exception {
    54         PaintVisitor visitor = new MapPaintVisitor();
     54        Rendering visitor = new StyledMapRenderer(g,nc,false);
    5555        nc.zoomTo(bounds);
    56         visitor.setGraphics(g);
    57         visitor.setNavigatableComponent(nc);
    58         visitor.setInactive(false);
    5956        for (int i=0; i<iterations; i++) {
    60             visitor.visitAll(ds, true, bounds);
     57            visitor.render(ds, true, bounds);
    6158        }
    6259    }
Note: See TracChangeset for help on using the changeset viewer.