Commit graph

6473 commits

Author SHA1 Message Date
Chris Wilson
03df52a833 image: Correct origin of unbound recording surface source
Clearly demonstrated by using the test-base with the recording surfaces
and exemplified by the fallback-resolution with PDF, which is *almost*
fixed!

We're very close to making a release candidate for 1.12 now...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-03 12:35:07 +00:00
Chris Wilson
8968f01035 base: Remove the double application of the clip boxes
The clipping code was modified to handle partial boxes itself, so update
the base compositor to simply use the core clipping code and avoid
double application.
2012-03-02 12:31:41 +00:00
Zhigang Gong
b8a6019e0c mono: Always bias initial edge advancement
Even for a vertical edge, we still need to bias the error term otherwise
later we will find the error term is too larger and advance a pixel on
every row.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 14:41:58 +00:00
Chris Wilson
cdbf4c60fe spans,traps-compositor: Check for all-clipped after intersecting clip with boxes
If the mask does not intersect the clip, then there is no drawing to be
performed and we can report NOTHING_TO_DO.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 14:40:06 +00:00
Seongwon Cho
300e32a4a9 mono-scan-convertor: Include space for the closing span
When estimating the maximum number of spans required for a particular
width, we need to include a closing span.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 12:18:11 +00:00
Chris Wilson
2587b9dfd3 ft: Export FreeType synthesis options
Currently you can only specify that a cairo_ft_font_face_t should
synthesize a font (to make a bold variant) through an FcPattern. That is
direct consumers of the public cairo-ft API have no control over the
synthesize options.

Rectify this by creating some public API to allow control over the
synthesis flags, and include the ability to construct an oblique as
well an embolden font.

Based on a patch by Deokjin Kim <deokjin81.kim@samsung.com>.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 12:04:54 +00:00
Chris Wilson
231f0e32b9 ft: Remove unused HINT_METRICS from ft_font.extra-flags
This is handled through the normal cairo_font_options_t and was not
used.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 11:22:13 +00:00
Chris Wilson
a49a26f961 gl: Various fixes for glyphs
Not 100% improvement, there are still a variety of failures with
GLXWindows, but getting there. At least it fixes more things than its
breaks...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 10:27:39 +00:00
Chris Wilson
3c665102c2 spans+image: Fix clipping with polygons and spans
Fixes: clip-source, random-clip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 22:27:18 +00:00
Chris Wilson
be5ab6df68 surface-wrapper: Apply the scaled-font ctm and non-default font-options
Improves record*-text-transform.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 18:11:22 +00:00
Chris Wilson
ef7e57f0fd scaled-font: Assign a temporary hash value for the placeholder
Fixes [large-]twin-antialias-mixed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 17:44:15 +00:00
Chris Wilson
4429c7a301 scaled-font: Refactor the hash computation
Remove the cut'n'paste duplication and replace the hash computation with
a proper function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 15:05:57 +00:00
Chris Wilson
da381da7f3 scaled-font: Key the cache on the original font face
Complete the task started in cd4b2d843b by
remembering to compute the insertion hash on the original font face as
well as the lookup hashes. Also take advantage by deferring resolution
of the implementation for the font face until after we fail to find an
already constructed scaled font.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 14:50:16 +00:00
Chris Wilson
b1b5e9b908 surface-wrapper: Apply replay transforms to scaled font
Improves: record2x-select-font-face, record2x-text-transform
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 14:48:59 +00:00
Adrian Johnson
2d3a1c7318 pdf: ensure all transparency groups are isolated 2012-02-25 16:57:58 +10:30
Chris Wilson
7154f646d3 pdf,ps: The device offset only needs to taken into account for raster patterns
Ordinary patterns have their device offsets pre-baked into the pattern
matrix. The difference with raster patterns is that the surface is
generated upon use by the pdf,ps and so its device offset is not known
until then.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 16:15:31 +00:00
Chris Wilson
513841263e recording: Remove superfluous reset
When merging the two-clauses, I forgot to remove the second
_cairo_recording_surface_reset()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 14:07:10 +00:00
Chris Wilson
c39cb77d64 subsurface: Fix typo in snapshot creation
I need to remember that the translation for the pattern matrix is the
inverse of the translation for drawing.

Fixes: subsurface-modify-parent
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 13:51:25 +00:00
Chris Wilson
b2cb9ec31e recording: Optimize a copy of one recording surface onto another
Rather than store a command to copy from a reference of another recording
surface onto this, just replay the other recording surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 13:51:25 +00:00
Chris Wilson
8028f04a91 debug: Add some TRACE statements for recording surfaces and snapshots
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 13:51:25 +00:00
Chris Wilson
6b5199645a image: Handle recursive drawing of recording surface
Borrow the technique for installing a proxy-snapshot developed for
acquiring the image from a recording surface.

This prevents the cairo from exploding and using up all memory due to
infinite recursion, but it does break a few tests that perform
self-copies with differing transformations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 13:50:11 +00:00
Chris Wilson
080bcfcb1a {mask,traps}-composite: Restore unsetting of the is-clear flags for the mask
I forgot that creating any image by defaults results in pixman
calloc'ing the pixel data and so cairo helpfully sets the is-clear flag
on the surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 12:14:48 +00:00
Chris Wilson
b079f18fad xlib: Handle window-to-window copies by avoiding the use of a clip region
Rather than compress the copies into a clip + copy, iterate over and
perform each copy separately so as to avoid the confusion for
window-to-window copies and the solitary GC->pCompositeClip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 13:44:28 +00:00
Chris Wilson
cc09b29752 xlib: Tidy conversion of xrender format to cairo_content_t
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 13:44:28 +00:00
Chris Wilson
716a79bfcb xlib-xcb: Wrap cairo_xlib_device_debug_cap_xrender_version
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 21:33:43 +00:00
Chris Wilson
7e3c963191 surface-wrapper: Transform the clip by the device-transform correctly
Fixes paginated fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 19:55:22 +00:00
Chris Wilson
d6908135f4 image: Tidy reduction to EXTEND_NONE for replay surfaces
As _cairo_surface_get_source() returns the limits of the source, a chunk
of code to query the source extents became redundant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 19:54:43 +00:00
Chris Wilson
58639857f9 script: Update mesh pattern for earlier change of csi operators
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 17:42:16 +00:00
Chris Wilson
1b1b1ecc6f traps-compositor: add a missing release()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 15:57:36 +00:00
Chris Wilson
e5cb567f5d xlib: Trim the ximage to match the trimming of the intermediate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 15:49:34 +00:00
Chris Wilson
1111cc50d3 xlib: Make the core compositor actually paint
It helps to actually set the fill colour when drawing...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 15:44:55 +00:00
Chris Wilson
5b107587e7 xlib: Correct the device-offset applied to the map-to-image result
A typo, a typo surely, to use extents->y twice instead of the more
normal x, y.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 15:13:26 +00:00
Chris Wilson
85110d9ce1 xlib: Trim the intermediate upload image to match the upload extents
Rather than transform the whole image, just convert the region of
interest.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 15:06:48 +00:00
Chris Wilson
89fddc38eb traps-compositor: Reduce a complex clip generation to an ADD operator
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 12:57:12 +00:00
Chris Wilson
9e640c7ae2 mask-compositor: Acquire the target surface when creating the composite mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 12:32:44 +00:00
Chris Wilson
605f23d155 xlib: Hook up copy_boxes for the mask compositor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 11:27:05 +00:00
Chris Wilson
3d499ea901 xlib: Replace obsolete disable-xrender with shiny new device debug interface
As prototyped with xcb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 10:41:37 +00:00
Chris Wilson
2d74eaf92f image: Add the get-font-options callback again.
In the midst of trying to simply export the
_cairo_image_surface_get_font_options() for subclassing, I accidentally
decoupled it from the image surface backend. Mea culpa.

Fixes regression from 8bea52bb (Add preliminary damage tracking), which
should not have even touched the backend structure except for an ugly
rebasing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 21:05:54 +00:00
Andrea Canciani
86a7533d0a stroke-style: Silence gcc warning
and make it more obvious that we're not doing OOB accesses.

They were not possible because of the parity constraint, but by
guarding the highest index with which we access the data in the loop,
the correctness information is completely contained in the loop code.

Fixes:

cairo-stroke-style.c:199:2: warning: cannot optimize loop, the loop
counter may overflow [-Wunsafe-loop-optimizations]
2012-02-20 12:32:53 +01:00
Andrea Canciani
d3b6e151a2 path-fixed: Silence gcc warnings
_cairo_path_fixed_last_op() contains an assertion, which gcc doesn't
like to inline. Since it is a static function, which basically
accesses a value, gcc will inline it anyway when assertions are
disabled, so remove the "inline" hint to reduce gcc warning noise when
doing debug builds.

Fixes:

cairo-path-fixed.c: In function '_cairo_path_fixed_drop_line_to':
cairo-path-fixed.c:373:1: warning: inlining failed in call to
'_cairo_path_fixed_last_op.isra.5.part.6': call is unlikely and code
size would grow [-Winline]
cairo-path-fixed.c:400:1: warning: called from here [-Winline]
...
2012-02-20 12:32:53 +01:00
Adrian Johnson
01ea2d31cb type1-subset: ensure additional glyphs required by seac operator are parsed 2012-02-18 21:49:47 +10:30
Adrian Johnson
09b90611a1 type1-subset: some fonts have "noaccess put" instead of NP in the Subrs 2012-02-18 21:49:47 +10:30
Andrea Canciani
c60627e8af device: Minor documentation fixes
Do not list CAIRO_DEVICE_TYPE_INVALID twice.

CAIRO_DEVICE_TYPE_WIN32 does not indicate that the type is cogl, but
win32.
2012-02-15 23:37:30 +01:00
Chris Wilson
83af31f0f3 win32: Cast the surface to an image-surface to find its parent (compile fix)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 19:48:07 +00:00
Chris Wilson
df608e0fab win32: Fix lifetime tracking of create_similar_image()
As we return the child image to the user and so perform the reference
tracking on it and not the parent win32 display surface, we need to add
a call to destroy the parent from the image surface. This of course
complicates the normal scenario of destroying the parent first, and so
in that case we need to unhook the image->parent before freeing the
surface->image.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 18:29:26 +00:00
Chris Wilson
ae3319890e win32: Rebase on the new compositor infrastructure
Try and undo all the damage that has acrued over the years by plugging
into the compositor pipeline.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42739
References: https://bugs.freedesktop.org/show_bug.cgi?id=42821
References: https://bugs.freedesktop.org/show_bug.cgi?id=33081
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:37:11 +00:00
Chris Wilson
92c0b37d04 win32: Move to separate directoy
I suspect I may split the win32 code into a few more files, so move it
to its own directory to reduce the clutter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:21:01 +00:00
Chris Wilson
8bea52bb0b Add preliminary damage tracking
This is initially based around the requirements for handling internal
fallbacks to the image compositor and reducing the number of pixels
required to be transferred.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:21:00 +00:00
Nis Martensen
c7d8ec72e6 doc: fix typo
The pattern creation function call in the example code has one _mesh too
much. This hopefully fixes the mesh mismatch mess :)

Signed-off-by: Nis Martensen <nis.martensen@web.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-14 21:04:25 +01:00
Oleg Romashin
4f81940749 qt: Fix compilation, also minor fix for building against Qt5
Update to latest surface backend structure, removed obsolete functions
and fixed functions API in order to be compatible with backend definition.

Fixed compilation with Qt5
2012-02-12 09:57:00 +00:00