Modify

Opened 9 years ago

Last modified 8 years ago

#12415 new defect

[patch] temporary layer did not use use antialiasing

Reported by: kolesar Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: antialiasing layer Cc: michael2402

Description (last modified by kolesar)

First version of this ticket was named "draw mode did not use use antialiasing". Later I have discovered that many mapmode tools draw to the same temporary layer. Instead of copying the same logic to the tools I have moved setting antialiasing to MapView where this temporary layer is created.

MapView asks MapRendererFactory for an instance of AbstractMapRenderer that applies the same setting for antialiasing as data layers use, regarding to separate antialiasing setting of wireframe mode.

Please use later patch named TemporaryLayerUseAntialiasing.

Attachments (2)

DrawModeUseAntialiasing.patch (4.2 KB ) - added by kolesar 9 years ago.
TemporaryLayerUseAntialiasing.patch (5.1 KB ) - added by kolesar 9 years ago.

Download all attachments as: .zip

Change History (16)

by kolesar, 9 years ago

comment:1 by kolesar, 9 years ago

Description: modified (diff)
Summary: [patch] draw mode did not use use antialiasing[patch] temporary layer did not use use antialiasing

by kolesar, 9 years ago

comment:2 by bastiK, 9 years ago

Great!

This is not only an issue for temporary layers, but also for real layers: If you put a marker layer or validator layer on top of a data layer, then the top layer will inherit the antialiasing settings of the layer below.

I can see strange glitches, i.e. it switches between aa and no aa. This must be because sometimes it uses nonChangedLayersBuffer and the drawing of the data layer is skipped. This leaves the Graphics2D object in its virgin no-aa state. However when the data layer is redrawn, the marker / validator layer is in also in aa mode.

We should set aa to a default value before drawing each layer (inside the loop). I think this default value should be "no aa" for real layers: A layer often displays lots of data and performance is highest priority. Of course this can (and should) be set in each individual Layer class.

Then, for temporary layers, it is a good idea to respect wireframe mode / default draw mode. But I think it would be even better to ask the active layer if it considers itself in aa or no aa mode (maybe default return value null == "i don't care"). Practically this is pretty much the same, but I feel it is the active layer's job to dictate this. In principle, JOSM is not limited to osm data layers - think of a plugin that edits gpx layer in place, etc.

comment:3 by Don-vip, 9 years ago

Keywords: antialiasing layer added
Milestone: 16.03

improving antialiasing for all layers is a great enhancement, can you please take bastiK's remarks into account? :)

comment:4 by Don-vip, 9 years ago

Milestone: 16.0316.04

Milestone renamed

comment:5 by Don-vip, 9 years ago

Milestone: 16.0416.05

comment:6 by Don-vip, 9 years ago

Cc: michael2402 added
Milestone: 16.0516.06

@Michael: maybe this one would interest you? :)

comment:7 by michael2402, 9 years ago

I'll have a look at it. Temporary layers are on the TODO-List for next week (I'll prepare some patches to be included after 16.05).

A first note: I plan on splitting the layer drawing code and add a paintAll() to each layer that does the same as the paint() in JComponent. We can put the setup code there, that way each layer can do it's own setup if required.

Last edited 9 years ago by michael2402 (previous) (diff)

comment:8 by Don-vip, 8 years ago

Milestone: 16.0616.07

comment:9 by Don-vip, 8 years ago

Milestone: 16.0716.08

comment:10 by Don-vip, 8 years ago

Milestone: 16.0816.09

comment:11 by Don-vip, 8 years ago

Milestone: 16.0916.10

comment:12 by simon04, 8 years ago

Milestone: 16.1016.11

Milestone renamed

comment:13 by Don-vip, 8 years ago

Milestone: 16.1116.12

Milestone renamed

comment:14 by Don-vip, 8 years ago

Milestone: 16.12

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to kolesar.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.