Commit graph

6538 commits

Author SHA1 Message Date
Henry Song
bc97bcf0ef gl: use direct mode for uploading gradient texture
The gradient is relatively small and any differences between upload
methods should be hidden by the caching. As it stands, using pbo with
the gradient fails with fglrx. As the workaround to use a simple
TexImage2D is inconsequential (may even be a minute win) and simplifies
the code, just do it.
2012-03-22 23:13:30 +00:00
Chris Wilson
02e3b6bc80 directfb: Tweak, tweak, tweak.
A couple of mistakes, such as inverting the logic as to when to flush
damage back from the shadow, meant that nothing happened when drawing to
the directfb surface.

Again still only compile tested.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 14:27:31 +00:00
Chris Wilson
be8a5f13b7 win32: Remove obsolete font rendering routines
These are now done by cairo-win32-gdi-compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 12:28:46 +00:00
Chris Wilson
28b3831223 win32: Hook up glyph creation again
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 12:28:46 +00:00
Chris Wilson
9bb5b02694 win32: Fix damage flushing
The damage wasn't being created on the right surface, so the damage to
the fallback image surface was not being tracked. Perform a little bit
of juggling so that we track dirty regions on the fallback surface itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 20:09:52 +00:00
Chris Wilson
c504dba5a7 damage: Fix memcpy size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 20:09:52 +00:00
Chris Wilson
eafa127001 compositor: Add tracing for damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 20:09:52 +00:00
Chris Wilson
86a89a8c1d win32: Check for damage before blitting
During the surface flush, we reduce any pending damage and then blit. If
no damage had been accrued then the damage->region would be NULL leading
to a segfault.

Patch suggested by Szuromi Gábor.

Reported-by: Szuromi Gábor <kukkerman@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47605
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-20 19:16:36 +00:00
Chris Wilson
0a778d974f stroke: Adapt rectilinear stroker to handle separable non-unity scaling
Reported-by: Christos Sotiriou <csotiriou@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 20:02:50 +00:00
Chris Wilson
a3612610b1 gl: Manually invert images without MESA_pack_invert extension
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 10:36:08 +00:00
Kouhei Sutou
cc98926cde skia: add a missing header into archive 2012-03-19 10:28:56 +00:00
Henry (Yu) Song
efb2018309 scaled-font: Ignore empty glyphs when checking for potential overlap
A zero-sized box contains no pixels and so cannot overlap, but it does
still need to contribute to the extents.
2012-03-13 18:57:47 +00:00
Chuanbo Weng
91113a9e45 subsurface: Avoid potential crash when subsurface's size is less than 0
When cairo_surface_create_for_rectangle() is given non-integer parameters,
the subsurface's size may be negative(e.g x = 0.2, width = 0.7, the
final width will be -1). This illegal surface may cause crash somewhere
upon later use, and although the fractional subsurface is ill-defined,
we should never crash!
2012-03-13 11:19:23 +00:00
Chris Wilson
d67f02e23e spans-compositor: Only destroy the clip if we made the copy
The extents->clip may be replaced elsewhere and so we cannot assume that
simply because it changed from the stashed value, that it was us that
made that copy. So becareful to only free our copy.

Fixes a double-free of a clip after a complex fallback operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 11:16:39 +00:00
Chris Wilson
94a9e06a93 clip: Intialise polygon fill-rule prior to use
The earliest use of the clip path's polygon fill rule is now for
intersecting the original polygon with the plurality of clip boxes.
However, the initialisation of the fill rule remained after the
intersection.

==8968== Conditional jump or move depends on uninitialised value(s)
==8968==    at 0x4C99449: _cairo_polygon_intersect (cairo-polygon-intersect.c:1382)
==8968==    by 0x4C9B788: _cairo_polygon_intersect_with_boxes.part.12 (cairo-polygon-intersect.c:1520)
==8968==    by 0x4C6AE6E: _cairo_clip_get_polygon (cairo-clip-polygon.c:104)
==8968==    by 0x4CAA667: clip_and_composite_boxes.part.13 (cairo-spans-compositor.c:773)
==8968==    by 0x4CAAD1D: clip_and_composite_boxes (cairo-spans-compositor.c:758)
==8968==    by 0x4CAB25C: _cairo_spans_compositor_fill (cairo-spans-compositor.c:1023)
==8968==    by 0x4C6CB69: _cairo_compositor_fill (cairo-compositor.c:184)
==8968==    by 0x4C7CE3E: _cairo_image_surface_fill (cairo-image-surface.c:945)
==8968==    by 0x4CAE2B6: _cairo_surface_fill (cairo-surface.c:2047)
==8968==    by 0x4C74AB7: _cairo_gstate_fill (cairo-gstate.c:1268)
==8968==    by 0x4C6E6D3: _cairo_default_context_fill (cairo-default-context.c:1009)
==8968==    by 0x4C67944: cairo_fill (cairo.c:2105)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 18:49:19 +00:00
Chris Wilson
ea0703524f image: Support SRC compositing with in the inline span-compositor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 18:49:19 +00:00
Chris Wilson
e0be011207 skia: Setup opacity for cairo_paint_with_alpha()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 12:05:26 +00:00
Chris Wilson
ab0e224b99 skia: compile fix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:46:50 +00:00
Chris Wilson
f7d4653c1b stroke: Do not initialise the pen if will not use it
The pen is only used for ensuring that we generate consist vertices
around a fan used for end-capping or line-joining when set to ROUND.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:46:50 +00:00
Chris Wilson
5ff689c017 mono-scan-converter: Use edge->is_vertical flag
The earlier bug found in edge advancement was actually due to the missed
opportunity of not performing the increment when we know the step is
zero.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:46:50 +00:00
Chris Wilson
07b540fd35 bentley-ottmann: Sort by edge bounding boxes before computing x
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:46:50 +00:00
Chris Wilson
247c42357c bentley-ottmann: Skip intersection check if the bounds do not overlap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:46:49 +00:00
Chris Wilson
2ab171467b hash: Keep a simple lut in front of the main hash
Whilst we wait for IvyBridge with its fast integer divide, in the
meantime avoid the overhead by inspecting a smaller simpler cache before
doing the full hash table lookup.

Shaves around 10% off glyph microbenchmarks for -image.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:46:49 +00:00
Nis Martensen
002a3d8b95 doc: fix broken link
cairo_win32_scaled_font_create_for_logfontw() does not exist. Probably
cairo_win32_font_face_create_for_logfontw() was meant instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:30 +01:00
Nis Martensen
ed89a3eeb0 doc/xcb: document cairo_xcb_device_get_connection
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:30 +01:00
Nis Martensen
e44186fdfe doc/xlib/xcb: document get/set_precision API
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
423990ba70 doc/ps-surface: minor improvements
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
70af9e6851 doc/ft-font: add reference to cairo_ft_synthesize_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
f22ecd3568 doc: describe cairo_recording_surface_get_extents
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
2184bd6672 doc: avoid confusing gtk-doc by double asterisks
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
6d2582a22a doc: move value descriptions up
to make gtk-doc happy

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
16d6b938c8 doc: ensure "compatibility" spelling
This changes not only comments, but also code!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
6ce412e15a doc: symbol names in header and comment must match
The names of the function arguments in the function prototype and
in the description comment must match, otherwise gtk-doc is confused.
When the argument names differ between function prototype and
definition, use the names from the prototype.

Also add a missing colon.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
b42270a3f1 doc: preserve whitespace by using docbook screen tag
Using the programlisting tag is not appropriate everywhere. Use the
screen tag where the formatting shall be preserved and the text is no
code listing.

Also add whitespace to prevent gtk-doc from inserting paragraph breaks.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:29 +01:00
Nis Martensen
77da76ac6c doc: fix a few typos found by codespell
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
4a1d420558 doc: script_mode_t needs at least one line of text
Gtk-doc recognizes documentation only if there is additional text.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
344d62b011 doc: Add colon to Returns statement
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
6b2d12e78a doc: do not confuse gtk-doc by @ and double *
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
e1c9e7acfc doc: add missing _face to function names
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
95ba71812d doc: add colon to .._padded_image_from_image
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
acf50966e6 doc: typo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Nis Martensen
4353eafa32 doc: add missing colons to since tags
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Chris Wilson
1952fec829 surface: Relax assertion about not rendering to a snapshot
Recently I began using the surface->snapshot_of member of a subsurface
to cache a target representation of the current subsurface. More
recently, I discovered this caused an assertion failure in epiphany, and
probably other GTK3 based programs.

Throwaway the assertion and trust that the programmer doesn't make any
mistakes...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 15:20:21 +00:00
Martin Robinson
04108ce492 gl/msaa: Do not attach a depth-stencil attachment to the default framebuffer
Only texture surfaces need to have a depth-stencil attachment.
The default framebuffer is responsible for managing its own
depth and stencil attachments.
2012-03-07 00:02:52 +00:00
Chris Wilson
3454604459 xlib: Apply the glyph offset
The (dst_x, dst_y) parameters passed to the XRenderCompositeText are
misleading and do not perform any adjustment, so we have to do it
ourselves.

Fixes clip-operator

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 21:13:20 +00:00
Chris Wilson
ad758280b6 traps: The CompositeTrapezoids requires the unbounded fixup for clipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 21:13:17 +00:00
Chris Wilson
753007ea00 traps: Avoid double application of unaligned clip boxes
Both combine-with-clip functions now take care of any intersection with
clip boxes so the result would be to have overdrawn the unaligned clip
box mask twice.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 21:13:17 +00:00
Chris Wilson
d40b90a577 clip: Use the boxes-intersection routine for computing the clip polygon
If we have more than a single box, run the boxes intersection as a
post-processing step on the clip polygon, as it should be faster than
doing it inline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 15:00:53 +00:00
Chris Wilson
f8f0510f89 image: Add unbounded support to the mono rasteriser fast-paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 14:42:19 +00:00
Chris Wilson
5bd29eda63 surface-wrapper: Only apply the wrapped transform to the scaled-font
And not the device_transform of the target. This smells fishy, but
appears to make the test suite happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 14:11:49 +00:00