Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This change makes several tests behave more like ps-eps.c, et al by
making them attempt to mkdir "output", and in case of trouble use "."
instead. filenames are now allocated at runtime due to this change, so
ensure the corresponding free()'s are in place as well.
This should facilitate running the test suite with a relative path
outside cairo's source tree, such as when employing the CAIRO_REF_DIR
environment variable.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The standard location for test output is cairo/test/output. The harness
itself was updated to write automatically generated images in this
directory, however a number of tests generate their own local output
files.
This patch updates these tests to write their output into
CAIRO_TEST_OUTPUT_DIR (which defaults to cairo/test/output) as well, in
the interest of decluttering the test directory.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Tests should be placing output files in the output/ directory now,
although not all tests follow this standard practice. Drop the
"*.out.*" from .gitignore to make improper test behavior more evident.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
None of the SVG viewers I tried (rsvg, firefox, inkscape) support CMYK
Jpeg images.
Bug 68965
|
|
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Without this most code that uses similar surfaces for offscreen
rendering will render in a pixelized fashion if the final
target uses a device scale.
|
|
We merge _cairo_surface_create_similar_scratch and
_cairo_surface_create_similar_solid into a single function named
_cairo_surface_create_scratch, to avoid confusion with
cairo_surface_create_similar which now will have a different
behaviour wrt the sizes and the device-scale.
_create_scratch assumes the width and height are in backend
coordinates, while create_similar does not.
|
|
We copy the _cairo_surface_create_similar_solid code into
cairo_surface_create_similar so that we can separate these later
as one wants to use backend sizes and one not.
|
|
Such as CAIRO_TEST_MODE=scale for testing application of
cairo_surface_set_device_offset.
CAIRO_TEST_MODE=similar - test rendering through similar surfaces
CAIRO_TEST_MODE=offset - test rendering with a device offset
CAIRO_TEST_MODE=scale - test rendering with a device scale
|
|
|
|
This adds the new public functions
cairo_surface_set_device_scale and cairo_surface_get_device_scale and
updates old users of the internal functions.
|
|
As the replay of the recording surface applies the device_transform of
the matrix once again to all its operations, we end up with a repeated
transform through the source matrix of the recording surface. We need to
remove one of these, and the easiest way to do that appears to be to
undo the application to the source matrix.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When creating a transformed pattern we must apply the device
transform *before* the transform set on the pattern itself, otherwise
e.g. its translation will not be affected by the device scale.
We also fix up the device_transform related handling in
_cairo_default_context_pop_group(). With a device scale we can
no longer just use the device_transform_inverse to unset the
device offset for the extents, so we make that a simple translate
instead.
We also remove some weird code that tries to handle the device
transform but seems unnecessary (maybe a workaround for applying
the device transform in the wrong order?). With that code removed
things work fine, but with it things get translated wrongly when
there is a scale.
|
|
If we do this in surface it will be applied twice then
we chain to a different surface, like e.g. a subsurface.
We also remove a hack in cairo-surface-wrapper where it compensated
for the device scale not being applied.
v2: Compute the backend CTM in ensure_scaled_font().
|
|
|
|
Without this we will only render to part of the newly created
surface and then copy+scale that part back, which causes fuzziness.
|
|
We need to apply the device transform to the ctm when stroking, as
otherwise line widths are not affected by the device scale.
|
|
I had a look at how complex would it be to add correct downscaling to
Cairo now that Pixman supports convolution filters. It turns out it
this is rather easy. Here is an initial, minimal attempt. It uses
convolution filters only if the image is being downscaled by more than
half a pixel in at least one dimension.
Some discussion:
1. The sampling and reconstruction kernels are picked in a way that
gives comparable quality when upscaling and downscaling. I paired box
sampling with bilinear reconstruction and impulse (point) sampling
with box reconstruction. This gives the expected result for NEAREST
filter. BEST filter uses Lanczos3 for both kernels.
> Do we need to use a reconstruction filter for NEAREST at all? Or maybe
> differentiate between NEAREST and FAST in that case?
If impulse (point) sampling is used, there must be some reconstruction
filter, otherwise no image is produced. That's because the sampling
grid does not match the data grid, and since there is no
reconstruction filter, values between data points are undefined. The
alternative is to use box sampling + no reconstruction.
2. Subsampling bits are always set to 1, since this doesn't seem to
affect quality at all.
3. I am not sure whether this code works correctly for matrices with a
skew component. It should be OK for any combination of scale, rotation
and translation.
4. This patch causes new failures in the test suite:
- recording-surface*: possibly an effect of improved quality.
- surface-pattern-scale-down*, surface-pattern-big-scale-down: the
reference images should be updated.
- pthread-same-source: I have no idea why this is failing, since this
test shouldn't even trigger the new code.
- large-source-roi: this test attempts to downscale an image which is
30000 pixels wide down to 7 pixels. The filter parameters seem to be
created correctly, but they might trigger an overflow somewhere in the
convolution code; the output rectangle is white instead of red, as if
nothing was drawn.
- device-offset-scale: there are subtle differences which look like
convolution-related smoothing; I'm not sure whether this is OK or not.
|
|
|
|
|
|
|
|
A recursive include should hide the bare header from
check-preprocessor-syntax.sh
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Based on a patch and analysis by Michael Henning.
When we create a similar-image surface for win32, we set up a couple of
back references from the image to the win32 surface, and vice versa. We
need to be careful when decoupling the reference cycle to avoid chasing
around the loop upon destruction. Currently we handled destroying the
similar-image via the parent win32 surface, but similar precaution is
required when destroying the surface via the similar-image.
Reported-by: Michael Henning <drawoc@darkrefraction.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63787
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The goal is to allow compilation against older pixman to ease regression
testing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When creating a texture surface that is larger than the maximum
framebuffer or texture dimensions of the context, return a surface in
error. Previously the code failed an assertion, but this prevents an
application from easily detecting when to fall back.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
OpenGLES also uses the depth/stencil buffer when doing multisampling, so
it's a leak to only clean up the buffer for desktop OpenGL.
|
|
This fixes a crash in the api-special-cases with xlib-xcb when calling
cairo_clip_extents() on a context that refers to a finished surface.
The crash was a simple NULL pointer dereference, because the underlying xcb
surface that was used in xlib-xcb was gone and set to NULL already.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Make cairo_push_group() fail when the context's target surface is finished.
This fixes the api-special-cases for the xcb backend:
Detected error during xcb run: error=9, seqno=0x13c, major=53, minor=0
The problem was that the Pixmap for the cairo surface was already freed and
cairo still tried to use it again as the drawable in a CreatePixmap request.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Finished surfaces and surfaces with an error status must not be usable anymore,
so refuse to work on them.
This improves the result for api-special-cases.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68014
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This adds code to the api-special-cases test which also tests the behavior of
cairo when the cairo context or the surface that is target is in an error state
or finished. These new tests call into all public entry points defined in
cairo.h which receive a cairo_t * as their first argument.
Currently this causes a new crash in the testsuite:
cairo-surface.c:394:
_cairo_surface_begin_modification: Assertion `! surface->finished' failed.
Reported-by: christophe.troestler@umons.ac.be
References: https://bugs.freedesktop.org/show_bug.cgi?id=68014
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The macro benchmarks were moved to a separate repository some time ago,
but the perf README still refers to these tests as if they were still
present, which may lead to some confusion. Instead, consolodate the
macro benchmark documentation with the macro benchmarks, and focus this
README on just the (still in tree) micro-benchmarks.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When the latin subset contains glyphs that use the seac operator to
combine two glyphs, additional non winansi glyphs are added to the
subset. These extra glyphs do not have a winansi name so they can't
be renamed.
Based on a patch by Salvador Ortiz.
Bug 67324
|
|
Even when using the stencil buffer for clipping, always scissor the clip
extents. This simplifies the code a bit.
|
|
When blitting the framebuffer during transitions to and from
multi-sampling mode, we need to disable the stencil and scissor test so
that the entire surface is preserved. This fixes the bitmap-font test
for the MSAA compositor.
|
|
When replacing the stencil buffer clip cache or destroying a surface,
destroy the cached clip. This prevents the clip from leaking.
|
|
See comments.
|
|
If subpixel rendering is enabled, but FT returns a 8bit gray bitmap
(perhaps because the font has 8bit embedded bitmaps) we were hitting
the assertions because the assumptions made were wrong. Fix up.
|
|
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|