Bug 94962 - Imprecise stroke position at large coordinates when playing back a scaled recording surface
Summary: Imprecise stroke position at large coordinates when playing back a scaled rec...
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: image backend (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-16 09:25 UTC by Zoltan Turanyi
Modified: 2018-08-25 13:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
The code reproducing the error. (2.08 KB, text/plain)
2016-04-16 09:25 UTC, Zoltan Turanyi
Details
All is well at scale of 1 and around zero offset (1.05 KB, image/png)
2016-04-16 09:26 UTC, Zoltan Turanyi
Details
Still no problem at scale of 1 even if offset is large (1.11 KB, image/png)
2016-04-16 09:27 UTC, Zoltan Turanyi
Details
Line mis-aligned at large offset and non-integer scal (1.50 KB, image/png)
2016-04-16 09:28 UTC, Zoltan Turanyi
Details
Different deviation if scale is different (1.56 KB, image/png)
2016-04-16 09:28 UTC, Zoltan Turanyi
Details

Description Zoltan Turanyi 2016-04-16 09:25:25 UTC
Created attachment 122986 [details]
The code reproducing the error.

When I record a stroke and a show_text() at the same location to a recording surface, they show up at different locations during playback to an image surface if
- the coordinates of the elements are large (dont appear around zero, do appear around 20000)
- at certain scaling factors (not at integer scaling, but more pronounced at 1.6 or 1.87).

I attach a couple of images. They were created by the attached code. Essentially I record two items on a recording surface (a line and a piece of text) at the same vertical location (denoted by 'offset'). Then I play it back to an image surface using 'scale' scaling. Since I will be using large offsets I only replay the area 
around the two items. (The bug remains even if I replay the whole recording surface from (0,0) to the location items, but that would make comparison hard and images large.)

The first number in the image name is the scaling factor (*100), the second is the offset used.

The error seems to affect only the stroke, as you can see the text is always positioned at the middle of the viewport (as intended). However, the stroke is not drawn at the same location and the difference seems to depend on the offset and the scale. It seems to be linearly increasing by the offset and seems to vary somewhat randomly by the scale. For integer scales it does not appear. Overall I suspect this is some form of a rounding error, but could not figure this out even after some debugging.
Comment 1 Zoltan Turanyi 2016-04-16 09:26:39 UTC
Created attachment 122987 [details]
All is well at scale of 1 and around zero offset
Comment 2 Zoltan Turanyi 2016-04-16 09:27:09 UTC
Created attachment 122988 [details]
Still no problem at scale of 1 even if offset is large
Comment 3 Zoltan Turanyi 2016-04-16 09:28:06 UTC
Created attachment 122989 [details]
Line mis-aligned at large offset and non-integer scal
Comment 4 Zoltan Turanyi 2016-04-16 09:28:54 UTC
Created attachment 122990 [details]
Different deviation if scale is different
Comment 5 GitLab Migration User 2018-08-25 13:46:00 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/184.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.