Ignore:
Timestamp:
2016-02-09T16:14:48+01:00 (9 years ago)
Author:
bastiK
Message:

fix rendering in performance test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java

    r9458 r9769  
    22package org.openstreetmap.josm.data.osm.visitor.paint;
    33
     4import java.awt.Color;
    45import java.awt.Graphics2D;
    56import java.awt.image.BufferedImage;
    67import java.io.File;
    78import java.io.FileInputStream;
     9import java.io.IOException;
    810import java.io.InputStream;
     11import javax.imageio.ImageIO;
    912
    1013import org.junit.BeforeClass;
     
    1316import org.junit.rules.Timeout;
    1417import org.openstreetmap.josm.JOSMFixture;
     18import org.openstreetmap.josm.Main;
    1519import org.openstreetmap.josm.data.Bounds;
    1620import org.openstreetmap.josm.data.osm.DataSet;
     
    4145    @BeforeClass
    4246    public static void load() throws Exception {
    43         JOSMFixture.createPerformanceTestFixture().init();
    44         img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_3BYTE_BGR);
     47        JOSMFixture.createPerformanceTestFixture().init(true);
     48        img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB);
    4549        g = (Graphics2D) img.getGraphics();
    46         nc = new NavigatableComponent();
     50        g.setClip(0, 0, IMG_WIDTH, IMG_WIDTH);
     51        g.setColor(Color.BLACK);
     52        g.fillRect(0, 0, IMG_WIDTH, IMG_WIDTH);
     53        nc = Main.map.mapView;//new NavigatableComponent();
    4754        nc.setBounds(0, 0, IMG_WIDTH, IMG_HEIGHT);
    4855
     
    113120        test(200, dsCity, new Bounds(53.56, 13.295, 53.57, 13.30));
    114121    }
     122
     123    /** run this manually to verify that the rendering is set up properly */
     124    private void dumpRenderedImage() throws IOException {
     125        File outputfile = new File("test-neubrandenburg.png");
     126        ImageIO.write(img, "png", outputfile);
     127    }
    115128}
Note: See TracChangeset for help on using the changeset viewer.