Modify

Opened 3 years ago

Last modified 2 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 3 years ago.
TemporaryLayerUseAntialiasing.patch (5.1 KB) - added by kolesar 3 years ago.

Download all attachments as: .zip

Change History (16)

Changed 3 years ago by kolesar

comment:1 Changed 3 years ago by kolesar

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

Changed 3 years ago by kolesar

comment:2 Changed 3 years ago by bastiK

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 Changed 3 years ago by Don-vip

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 Changed 3 years ago by Don-vip

Milestone: 16.0316.04

Milestone renamed

comment:5 Changed 3 years ago by Don-vip

Milestone: 16.0416.05

comment:6 Changed 3 years ago by Don-vip

Cc: michael2402 added
Milestone: 16.0516.06

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

comment:7 Changed 3 years ago by michael2402

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 3 years ago by michael2402 (previous) (diff)

comment:8 Changed 3 years ago by Don-vip

Milestone: 16.0616.07

comment:9 Changed 3 years ago by Don-vip

Milestone: 16.0716.08

comment:10 Changed 3 years ago by Don-vip

Milestone: 16.0816.09

comment:11 Changed 3 years ago by Don-vip

Milestone: 16.0916.10

comment:12 Changed 3 years ago by simon04

Milestone: 16.1016.11

Milestone renamed

comment:13 Changed 2 years ago by Don-vip

Milestone: 16.1116.12

Milestone renamed

comment:14 Changed 2 years ago by Don-vip

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.
to The owner will be changed from team to the specified user.
The owner will change to kolesar
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.