Commit graph

6538 commits

Author SHA1 Message Date
Benjamin Otte
19da8e138d tee: Add proper error handling
Caught by api-special-cases
2010-07-05 22:40:54 +02:00
Benjamin Otte
6744b78de1 subsurface: Fail if created from a finished surface
Caught by api-special-cases test
2010-07-05 18:38:33 +02:00
Benjamin Otte
8fd1ecea12 surface: Fail if set_mime_data() is called on a finished surface
Caught by api-special-cases test
2010-07-05 18:38:33 +02:00
Benjamin Otte
e388ff1ae7 surface: Fail early if create_similar() is called on a finished surface
Caught by api-special-cases test
2010-07-05 18:38:33 +02:00
Benjamin Otte
c1689ef6f2 surface: don't call begin_modification on finished surfaces
Fixes https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/600622

Caught by api-special-cases test
2010-07-05 18:38:33 +02:00
Benjamin Otte
a1c4b001a5 boilerplate: Add a describe vfunc
This function is supposed to describe the backend in use. The describe
function is optional - and therefore initialized as NULL everywhere.
Note:
It is well known that the xlib backend uses X. What is not known is what
version the server supports or what graphics card it is running on. That
is the information the describe vfunc is supposed to provide.
2010-07-03 02:55:52 +02:00
Chris Wilson
4c039b1cdf user-font: Check the status before destroying the context 2010-07-02 17:02:19 +01:00
Chris Wilson
1f84f5682c xlib: Apply translation to image surface upload.
Fixes:

  Bug 28888 - cairo_paint with rgb images does not work correctly
  https://bugs.freedesktop.org/show_bug.cgi?id=28888
2010-07-02 13:19:17 +01:00
Andrea Canciani
d2d6c96c24 user-font: correct handling of size 0 text
Text with size 0 has a singular scale matrix, thus requires special
handling to avoid invalidating the context where it is used.

Fixes pthread-show-text and text-zero-len (they failed with assertion
when ran using the user font backend).
2010-06-30 12:31:25 +02:00
Andrea Canciani
6db247e13c user-font: ignore translation in scale matrix
Currently the translation component of the scaled_font scale matrix
is applied by gstate and only linear components should be applied in
font backends.

Fixes font-matrix-translation (when using user-font as font backend).
2010-06-29 09:28:04 +02:00
Andrea Canciani
549431e98e ft-font: fix typo 2010-06-28 22:40:28 +02:00
Chris Wilson
97a88c5adb xlib: Compile without fontconfig
Create a cairo-fontconfig-private.h where we can add the missing defines
in a common location rather than in the body of the code.
2010-06-28 17:11:54 +01:00
Andrea Canciani
7d69100143 quartz: remove unused declarations 2010-06-28 17:12:41 +02:00
Andrea Canciani
bd4c14b94e quartz: remove unused os version info
It was previously used to activate a workaround for text transformation
whenrunning on some os versions. Now the workaround is not needed anymore.
2010-06-28 16:55:57 +02:00
Andrea Canciani
aa7e9c43b6 quartz-font: correct and explain matrix computations
glyph_path was taking into account the translation (which currently
is already applied in gstate) and the sign of the elements of the
matrices was not explained.
2010-06-28 16:55:57 +02:00
Andrea Canciani
b26f72fef9 quartz: check return status
If the font backend is unable to tell the extents of the operation,
consider it unbound.
2010-06-28 16:55:57 +02:00
Andrea Canciani
9c0d761bfc quartz: improve text transform handling
Use scale instead of manually compositing font_matrix and ctm and
composite it with the context ctm, so that no workaround for clipping
is needed anymore.
2010-06-28 16:55:57 +02:00
Andrea Canciani
9068b5768b quartz-font: silence compiler warnings
Remove an unused function, explicitly ignore or check return values,
don't define unused variables.
2010-06-28 16:55:57 +02:00
Chris Wilson
8df4136119 Regenerate default win32 headers. 2010-06-26 09:52:11 +01:00
Benjamin Otte
1373675ef7 pop-group: Translate existing path properly
This fixes the reverse case of the push_group case fixed a few commits
ago.
2010-06-25 14:10:12 +02:00
Benjamin Otte
2e8571d95c push-group: Fix path translation when pushing a group with device offsets
With the previous code, the parent's device offset wasn't undone before
applying the new device offset.
Tested by push-group-path-offset test.
2010-06-25 13:48:07 +02:00
Chris Wilson
1099a3515b drm/intel: Fix common off-by-one by rewriting the [XY]MAX macro.
Many rectangles in the command stream are specified as inclusive rects,
i.e. the max values are (width-1, height-1), which is easy to neglect.
2010-06-24 17:29:19 +01:00
Chris Wilson
fb6a00571c drm: _cairo_color_get_content() compilation fixes 2010-06-24 17:29:18 +01:00
Zoxc
42956b4643 build: Added cairo deflate stream as a requirement for the script surface. 2010-06-24 15:28:07 +01:00
Benjamin Otte
413ec4b708 gl: Return a surface from _cairo_surface_create_in_error()
On error, surface creation functions should always return a surface
created with _cairo_surface_create_in_error() instead of a new surface
in an error state. This simplifies internal code as no refcounting has
to be done.
2010-06-22 23:19:32 +02:00
Benjamin Otte
a4e292507c gl: Propagate surface creation error instead of crashing 2010-06-22 22:01:25 +02:00
Benjamin Otte
faa4e6761c egl: Copy glx code to detect the proper surface in acquire 2010-06-22 20:21:15 +02:00
Benjamin Otte
76a721f7e9 egl: Remove unused prev_foo usage 2010-06-22 20:21:15 +02:00
Chris Wilson
b8051ee985 script: Pass the buffer length back to freetype.
After querying the required size, inform the backend of the allocated
size of the buffer.
2010-06-19 18:09:27 +01:00
Chris Wilson
8ac9a9df24 xcb: Return the status upon flushing the device.
The vfunc was updated to expect the status return, so supply it.
2010-06-19 13:23:50 +01:00
Chris Wilson
9fffc0e120 xlib: Precise and Imprecise were reversed.
The intention was to switch to imprecise mode by default, using the
exact rendering mode only upon request.
2010-06-19 11:15:13 +01:00
Chris Wilson
b322b2e619 xlib: Perform image uploads inplace.
Under the restrictive conditions where we are doing an untransformed
contained upload of an image into a matching surface, perform it in
place. The drivers will attempt to stream such uploads efficiently, far
more so than our code.
2010-06-19 10:52:52 +01:00
Benjamin Otte
3908d80f57 glx: Remove useless optimization trying to avoid glXMakeCurrent()
The optimization is not performance-relevant. And having less code is
always a good idea.
2010-06-18 16:31:52 +02:00
Benjamin Otte
64f90322f7 gl: Refactor status handling in _cairo_gl_context_release()
Previously, the code returned a status and required the caller to mangle
this status with his own status. Now, the function takes the previous
status ass an argument and does the mangling itself.

Also contains fixes for all the callers to actually check the return
value - which is now rather trivial as it just requires passing through
the status variable.
2010-06-18 16:31:52 +02:00
Benjamin Otte
fc3d521c12 gl: Inline the check_error() function 2010-06-18 16:31:52 +02:00
Benjamin Otte
9d7fa28913 gl: Don't assert if there used to be a GL error
When acquiring the GL context, do not assert that the GL context is not
in an error state. Do not even call _cairo_error(). Handling GL errors
in other code is not Cairo's responsibility.

Instead just clear all previous errors so we don't accidentally set
surfaces into error states to unrelated errors.
2010-06-18 16:31:52 +02:00
Benjamin Otte
0f9a8cd18f gl: Add a custom glGetError() function
This function clears all errors and returns the first one that happened.
2010-06-18 16:31:52 +02:00
Benjamin Otte
8048d3aa0a gl: Remove custom fprintf fudging on GL errors
Now that we probably call _cairo_error() on every GL error, there is no
need to use custom methods to catch those errors. The usual breakpoint
is enough.
2010-06-18 16:31:52 +02:00
Benjamin Otte
f4da5048bf gl: cairo_warn about return value from cairo_gl_context_release() 2010-06-18 16:31:51 +02:00
Kristian Høgsberg
67e84d6123 egl: Implement acquire and release for EGL backend 2010-06-18 10:12:06 -04:00
Chris Wilson
7ab9ce1b91 image: Make a local copy of the trap coordinates as the boxes alias.
As we transform the array of trapezoids into an array of boxes in-place,
we must take local copies of the coordinates before writing into the
boxes otherwise we may inadvertently modify the trapezoidal coordinates.

Fixes test/a1-bug.
2010-06-17 15:47:04 +01:00
Zoxc
a9a22649e2 wgl: Only reset GL context on the dummy window.
This changes the WGL context destruction code to only reset the GL
context for the dummy window, since doing it on <nothing> is an
invalid operation.
2010-06-17 09:21:07 +01:00
Zoxc
ca35e09ece gl: Added wgl boilerplate and moved the glx and egl boilerplates into their own files. 2010-06-17 09:21:07 +01:00
Zoxc
2af3262895 wgl: Renamed hwnd field to wnd. 2010-06-17 09:09:21 +01:00
Nicolaus L Helper
7a023a62f7 ft,fc,xlib: LCD filtering patch.
This adds internal API to retrieve the LCD filtering parameters from
fontconfig, or as set on the Screen, and feed them to FreeType when
rendering the glyph.

References:
  Bug 10301 - LCD filtering patch
  https://bugs.freedesktop.org/show_bug.cgi?id=10301

Tested-by: Brandon Wright <bearoso@gmail.com>
Forward-ported-by: Robert Hooker <sarvatt@gmail.cm>

ickle: The API is clearly not ready for public consumption, the enum are
poorly named, however this stands by itself as enabling system wide
properties.
2010-06-17 09:06:13 +01:00
Chris Wilson
36b4b0631c image: Use consistent rounding modes for a1 rasterisation.
When checking if the traps are equivalent to a set of rectangles, we
need to use the same rounding mode as when converting the traps to a set
of boxes and then filling them. Failure to do leads to a situation where
(-127,-128) was thought to be equivalent to (0,0) but we attempted to
fill from 0 to -1 instead.

References:
  http://lists.cairographics.org/archives/cairo/2010-June/020115.html
2010-06-17 08:55:19 +01:00
Chris Wilson
3306bcb1d9 fixed: Refactor code to use more inlines and less duplication of logic.
This also has the side-effect of fixing the types in the problematic
functions which hid Andrea's true fix for the unsigned FRAC_MASK.
2010-06-17 08:55:19 +01:00
Andrea Canciani
3cd0755932 correct rounding computation
cairo_fixed_integer_round[_down] were adding an unsigned mask value
before shifting its result, causing the shift to be computed as
logical (unsigned) right shift, thus producing incorrect values for
negative inputs. Making the mask value signed fixes this issue.

Bug report by cu:
http://lists.cairographics.org/archives/cairo/2010-June/020115.html
2010-06-16 22:59:46 +02:00
Chris Wilson
5262444663 glew: Define NULL 2010-06-15 10:40:36 +01:00
Chris Wilson
072a200ec5 build: Add wgl to Makefile.sources and regenerate features. 2010-06-14 16:05:14 +01:00