Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Optimize Clipping Calls #1661

Copy link
Copy link
@Jonarw

Description

@Jonarw
Issue body actions

Currently, every plot element is responsible for its own clipping. Many series use the DrawClippedXxx(...) extensions from the RenderingExtensions and that way sometimes set and reset clipping multiple times per render (example).
Also, when you render many Series sharing the same axes, it wouldn't really be necessary to set and reset clipping every time.

Since #1645, we have some potential to reduce the amount of calls to IRenderContext.PushClip(...) and IRenderContext.PopClip() by moving the responsibility for the clipping out of the Series and Annotations.

Specifically I propose to:

Why would this be desirable?

  • Depending on the platform there could be a more or less significant performance penalty involved with every clipping
  • The file size of vector-based exports (especially SVG) can get bloated by many redundant clipping calls
  • Rendering code in Series and Annotations could be simplified in some places, as it wouldn't have to worry about clipping any more

Potential Problems

  • Removal of the DrawClippedXxx(...) extensions will involve some breaking changes for custom implementations. Sure, we could also just keep these, but I'd like to make people aware that they shouldn't be concerned with clipping anymore when implementing custom Series / Annotations.
  • CandleStickAndVolumeSeries - this is a bit of a weird one, because really it's two series in one and therefore needs to set different clipping areas during rendering. I would suggest to do a (hacky) fix for now and mark this as obsolete... I think people should be better off using individual CandleStickSeries and VolumeSeries anyway.
  • (more might emerge once I refine the proof-of-concept implementation I currently have)

I will put together a PR soon so we can talk more specifically about the proposed changes.

VisualMelon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.