Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
xorg-x11-server.28104
U_mi_miarc_cache_arc_span_data_for_dashed_arcs....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_mi_miarc_cache_arc_span_data_for_dashed_arcs.patch of Package xorg-x11-server.28104
Git-commit: 0d7f05ed99b71a4641415c9f26e245c3bb24a9a0 Path-Mainline: Upstream Author: Adam Jackson <ajax@redhat.com> Subject: [PATCH xserver] miarc: "Cache" arc span data for dashed arcs References: bnc#1019649 Signed-off-by: Michal Srb <msrb@suse.com> This avoids recomputing the span data for every dash. x11perf thinks this is a pretty modest speedup: 832919.4 840471.1 ( 1.009) 100-pixel dashed ellipse 672353.1 680652.2 ( 1.012) 100-pixel double-dashed ellipse 13748.9 24287.9 ( 1.767) 100-pixel wide dashed ellipse 9236.3 21298.2 ( 2.306) 100-pixel wide double-dashed ellipse But part of the reason it's so modest there is that the arcs are relatively small (100 pixel diameter at line width 10, so ~6000 pixels) and the dashes relatively large (30 on 20 off so ~6 dashes per quadrant). With larger arcs and finer dashes this is much more impressive. A fairly trivial testcase of a single 15000x13000 arc with the default {2, 2} dash pattern drops from ~3500 milliseconds to 10 milliseconds. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com> diff --git a/mi/miarc.c b/mi/miarc.c index d6be99000..71df4ab64 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1021,6 +1021,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) join[0] = join[1] = 0; for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) { miArcSpanData *spdata = NULL; + xArc lastArc; ChangeGCVal gcval; if (iphase == 1) { @@ -1037,10 +1038,17 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) miArcDataPtr arcData; arcData = &polyArcs[iphase].arcs[i]; + if (spdata) { + if (lastArc.width != arcData->arc.width || + lastArc.height != arcData->arc.height) { + free(spdata); + spdata = NULL; + } + } + memcpy(&lastArc, &arcData->arc, sizeof(xArc)); spdata = miArcSegment(pDrawTo, pGCTo, arcData->arc, &arcData->bounds[RIGHT_END], &arcData->bounds[LEFT_END], spdata); - free(spdata); if (polyArcs[iphase].arcs[i].render) { fillSpans(pDrawTo, pGCTo); /* don't cap self-joining arcs */ @@ -1097,6 +1105,8 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) } } } + free(spdata); + spdata = NULL; } miFreeArcs(polyArcs, pGC);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor