Skip to content

Apply operation pattern on GC #316

Open
eclipse-platform/eclipse.platform.swt
#2243
@akoch-yatta

Description

@akoch-yatta

Description
There are issues with GC in the context of double buffering that cannot be solved using the ImageGcDrawer. Adapting it would involve heavy refactoring from consumer side, which is not a good option. Therefor the best solution is to delay all drawing operations on the GC until the context (which zoom it will be drawn upon) is defined. This can be done by "storing" all operations inside the GC (similar to Transform, Path etc.) and apply it, when a handle for a concrete zoom is requested.

To simplify the code changes, we assume the GC is applied used in context of exactly one zoom. This is necessary for now, as the state of the GC (in GCData) is utilized outside of the GC as well to custom draw. If required this can be done later, but there are probably very few cases, where a GC would be needed to draw on multiple zoom values.

Reproduction

--

Expected Behavior

GC draws correctly in all double buffering scenarios

Necessary configuration:

--

Additional knowledge

--

Metadata

Metadata

Assignees

Labels

HiDPIA HiDPI-Related Issue or FeatureSWTIssue for SWT

Type

No type

Projects

Status

👀 In Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions