summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-09-05Normalize test images with minor gradient differencesFederico Mena Quintero15-0/+0
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Bryce Harrington <bryce@bryceharrington.org> Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05Normalize extended-blend-mask.{argb32,rgb24}.ref.pngFederico Mena Quintero2-0/+0
I don't see how the old reference file could have been generated. Things I tried: * Using an old pixman (but it seems that the relevant code for Adobe extended blend modes has not changed?) * Using the Cairo version where the test was first introduced. * Changing the alpha value from .5 to something else. Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Tested-by: Bryce Harrington <bryce@bryceharrington.org> Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05test/extended-blend.c: Remove obsolete comments about buggy librsvgFederico Mena Quintero1-3/+0
The comment said that using CAIRO_OPERATOR_SOURCE for the background triggered a librsvg bug, but the relevant commit message does not even include a link to a librsvg bug. Also, changing it from OVER to SOURCE completely breaks these tests (the reference images don't match at all), so this comment is stale. Just remove it. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-09-05cairo-analysis-surface: Quell invalid uninitialized variable warningFederico Mena Quintero1-3/+4
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2018-08-24Fix sp. sheeringBryce Harrington1-1/+1
Pointed out by keith.briggs@bt.com
2018-08-16doc: Add missing symbols to sections for recently added APIsBryce Harrington1-0/+8
2018-08-16build: Sp. fixBryce Harrington1-1/+1
2018-08-16Convert 3 headers to UTF8Bryce Harrington3-4/+4
Fix distcheck, which was failing on the copyright symbols in these files, because their encoding was not being detected as UTF-8.
2018-07-16[ft] Implement some more color conversion routinesBehdad Esfahbod1-7/+15
Makes new COLR/CPAL implementation in FreeType work with cairo now. Ie. Microsoft's Segoe UI Emoji Regular font renders (instead of crashing cairo.)
2018-06-15scaled-font: Fix glyph and cluster count checks (CID #983386)Bryce Harrington1-2/+2
num_glyphs and num_clusters are explicitly checked to be non-NULL at the beginning of this routine, and by this point in the code both have been deref'd multiple times, so checking them for NULL here again is superfluous. It looks like the intent here is to verify the glyphs and clusters arrays are non-NULL unless their counts are zero, so change the tests accordingly. Coverity ID: #983386 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2018-06-13gl: For glesv3 detection, use glesv2.pc + header checkBryce Harrington1-8/+11
There is no glesv3.pc provided by mesa, perhaps because the glesv3 support is provided by the libGLESv2 library. Don't bother testing for glesv3.pc, just check for glesv2.pc and then search for the gl3.h header file. This fixes an issue reported by Theo Veenker, where building with glesv3 enabled would result in a cairo.pc file that depends on the non-existant glesv3.pc.
2018-06-13polygon-intersection: Clarify ptr checks for right edges (CID #1160730)Bryce Harrington1-2/+3
The code is checking a variable is non-NULL after it's already been dereferenced in an assert. I'm not certain whether the assert should be conditionalized to only be tested when right != NULL (which would allow edges_end() to still be invoked), or if the function should assert right as non-NULL always. Coverity ID: #1160730 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-By: Uli Schlachter <psychon@znc.in>
2018-06-13type1-subset: Fix incorrect null ptr check from find_token() (CID #1160662)Bryce Harrington1-1/+1
subrs was already tested for NULL prior to this, and will never be NULL at this point. Meanwhile, find_token()'s return is unchecked (it can return NULL and is checked in all other calls). Quite clearly, this is a copy-paste error from the prior find_token call, and the intent was to check array_start not subrs. Coverity ID: #1160662 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-By: Uli Schlachter <psychon@znc.in>
2018-06-13pdf: Fix potential null ptr deref when creating smask groups (CID #1159559)Bryce Harrington1-1/+0
Patch 37a22669 improved performance by using bounding box extents. However, the code appears to be incorrect. If extents is non-NULL it copies its contents to group->extents, otherwise it sets group->extents to sensible defaults, but then goes ahead and tries to copy the undefined contents. This second copy is unnecessary if extents is non-NULL and will cause a crash if it is NULL. Drop the extra copy, guessing it's just a typo. Coverity ID: #1159559 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-By: Uli Schlachter <psychon@znc.in>
2018-06-13bo: Free event_y in case of error to prevent memory leak (CID ##1160682)Bryce Harrington1-1/+4
If the call to _cairo_malloc_ab_plus_c() fails, it returns an error without first freeing event_y. Coverity ID: #1160682 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-By: Uli Schlachter <psychon@znc.in>
2018-06-13snapshot: Don't use extra after it's been freed (CID #220086)Bryce Harrington1-1/+4
Note this changes the semantics of the value of extra_out such that it is set to NULL instead of left undefined in case an error is returned. Coverity ID: 220086 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-By: Uli Schlachter <psychon@znc.in>
2018-06-13bo: Check null return from _cairo_malloc_ab() (CID #1159556)Bryce Harrington1-2/+5
_cairo_malloc_ab() can return NULL under some circumstances, and all other callers of this routine in the Cairo codebase check its return, so do so here as well. Coverity ID: #1159556 Signed-off-by: Bryce Harrington <bryce@bryceharrington.org> Reviewed-by: Uli Schlachter <psychon@znc.in>
2018-06-13script-surface: Check for invalid ids (CID #1159557, 1159558)Bryce Harrington2-0/+3
If the bitmap's min is non-zero, _bitmap_next_id() could break out of its loop early, before initializing the prev variable. prev would then be dereferenced without a null ptr check. This condition should never occur in practice, so add an assert() to assure it doesn't. Same issue is present in trace.c. Coverity IDs: #1159557, #1159558 Reviewed-By: Uli Schlachter <psychon@znc.in> Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2018-06-13Bump version for new development tree, 1.15.13Bryce Harrington1-1/+1
2018-06-13test: Use C comment syntax, not C++Bryce Harrington1-1/+1
2018-05-31Fix test compilation when font-config is disabledAlexandre Bique1-2/+5
Building cairo without font-config fails because test/font-variations.c was getting compiled without freetype2. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-05-31win32: Copyedit recent commentsBryce Harrington2-4/+6
2018-05-31win32: Allow GDI operations for argb32 surfaces (allowed by surface flags)Vasily Galkin1-1/+2
This finishes a patch series to speed up CAIRO_OPERATOR_SOURCE when used to copy data to a argb32 cairo surface corresponding to a win32 dc from a "backbuffer" - DibSection-based cairo surface created with cairo_surface_create_similar(). This final patch allows the GDI compositor to be used on argb32 surfaces. For display surfaces, only copying is allowed with gdi (by BitBlt), since other operations are filtered by flags in implementations. But since copying pixels is the only operation used in the most common scenario (prepare an offscreen image and send it to the screen) - this is important for presenting argb32 windows with Cairo directly or with gtk+gdk (which nowadays always creates argb32 windows). Before this patch pixel copy worked by: 1. mapping image to memory (by copying data from window dc to system memory which is very slow on windows maybe due to gpu or interprocess access) 2. copying new data over that image. 3. copying updated image from system memory back to window dc. After this patch there is only one step: 2+3. Copying new data over window dc. Completely eliminating step 1 gives a very huge speedup and allows argb32 cairo drawing be as fast as typical dibsection-buffered gdi drawing. There is quick & dirty cairo-vs-gdi perf test made for this patch set: https://gitlab.gnome.org/galkinvv/cairo/snippets/109 See the Cairo mailing list for April 2018 for data and discussion of performance improvements. End-user visible speedup does present too - it relates to the following bug https://gitlab.gnome.org/GNOME/meld/issues/133 This Cairo speedup allows more simultaneous meld windows without eating 100% of cpu core time on spinner rendering.
2018-05-31win32: CAIRO_WIN32_SURFACE_CAN_RGB_BRUSH and other argb32 flags set+checkVasily Galkin2-14/+40
This belongs to a patch series that speeds up CAIRO_OPERATOR_SOURCE when used to copy data to an argb32 cairo surface corresponding to a win32 dc from a "backbuffer" - DibSection-based cairo surface created with cairo_surface_create_similar(). This patch introduces checks to ensure that no solid brush GDI operations are attempted when using argb32 surfaces. Doing this allows enabling usage of the GDI compositor when these surfaces are in use. To make these checks work, _cairo_win32_flags_for_dc disables STRETCHBLT, STRETCHDIB and RGB_BRUSH in the argb32 flag. _cairo_win32_flags_for_dc() is also refactored to make the distinction between rgb24 and argb32 more readable. All logic & flags for rgb24 surfaces are retained, except for the addition of CAIRO_WIN32_SURFACE_CAN_RGB_BRUSH. The logic of forbidding AlphaBlend on display surfaces is also kept as is without investigation.
2018-05-31win32: Introduce new flag to mark surfaces that support solid brush drawingVasily Galkin4-5/+8
This is part of a patch series to speed up CAIRO_OPERATOR_SOURCE when used to copy data to an argb32 cairo surface corresponding to a win32 dc from a "backbuffer" - DibSection-based cairo surface created with cairo_surface_create_similar(). This initial patch presents only private header changes without changing any implementation logic. The big problem with argb32 surfaces and GDI is that GDI is unable to correctly set the alpha channel when using operations other than BitBlt and AlphaBlend. To solve this, a CAIRO_WIN32_SURFACE_CAN_RGB_BRUSH flag is introduced in this commit to be mark surfaces that correctly handle such brushes - essentially all surface types except argb32. The _cairo_win32_flags_for_dc() call receives a new argument that is used to calculate the flag.
2018-05-29gl: Whitespace cleanupBryce Harrington13-531/+530
2018-05-07Drop stray patch from prior commitBryce Harrington1-26/+0
2018-05-07Use _cairo_malloc instead of mallocAdrian Johnson102-274/+300
_cairo_malloc(0) always returns NULL, but has not been used consistently. This patch replaces many calls to malloc() with _cairo_malloc(). Fixes: fdo# 101547 CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-21Fix assertion failure in the freetype backendUli Schlachter1-2/+2
Fonts are kept in a hash table, so when creating a new font, the code first checks the hash table for an already-existing entry and only then is a new instance really created. There is an assert that checks that the key used for the hash table lookup is the same as the instance that is created later has, because otherwise the hash table was checked incorrectly. This assert failed in some conditions. Fix this by fixing some places that initialised ft hash keys in a wrong way. Patch by Behdad Esfahbod and submitted via bugzilla. Source: https://bugs.freedesktop.org/show_bug.cgi?id=105746#c4 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=105746 Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-04-111.15.12 release1.15.12Bryce Harrington2-1/+50
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-11configure: Conditionalize color font feature for older freetype2Bryce Harrington1-0/+11
FT_HAS_COLOR() macro is unavailable in older freetype2 without the color font feature. Compile and link a source including FT_HAS_COLOR(); if it fails (which can happen on older FreeType2) then define FT_HAS_COLOR(x) as (0). Patch from suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02Disable skia from configureBryce Harrington6-52/+24
Implement suggestion by Adrian Johnson to comment out skia in configure.ac to avoid presenting it as an option to users. This was discussed on the Cairo mailing list in September 2017. Skia is not API stable and is not available in packaged+versioned forms, resulting in it being a continually moving target. I.e. it's pretty much always unusably out of date. The last update to the skia backend was in 2014, and had not been updated very regularly prior to that. We'll simply disable it for now. If no one complains by the next Cairo snapshot release, we'll assume no one is needing it and will drop the code entirely. Meanwhile, if anyone does need it, it can be uncommented and used. (The changes to the win32 build config appear to be automatically generated as a result of disabling the feature in configure. I'm committing them to avoid confusion.)
2018-04-02cairo-version: Fix version references in docsBryce Harrington1-2/+2
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82741
2018-04-02Cairo trivial typosUnknown17-19/+19
Found using `codespell -q 3 -I cairo-whitelist.txt` whereby whitelist contained: ``` amin iff lod writen ``` Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02csi-trace does not show helpsuzuki toshiya1-2/+2
csi-trace does not show help string correctly, due to a bug in its command line argument parsing. strcmp returns 0 when there is an exact match, which means it requires an inverted test. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02pthread-same-source: Refresh reference imagesUli Schlachter1-0/+0
I already did the same thing in commit 3e22a8580a804. That commit added a GENERATE_REFERENCE mode that does not use threads and used that for generating the reference image. However, the above commit falls into the range between commits fb57ea13e04d and 3d94269bd4. The later commit reverts the earlier one, which changed the way that image downscaling works / is used. This means that the reference image that were generated back then were broken. Thus, regenerating the images is the right thing to do. Signed-off-by: Uli Schlachter <psychon@znc.in> Acked-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02Skip font-variations test for missing fontsUli Schlachter1-1/+1
Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-03-15Fix a 'memory leak' in the image compositorUli Schlachter3-0/+22
There is a global pixman_glyph_cache_t instance that is initialized on first use and shows up in valgrind output as a relatively large leak (I think it was about 200 KiB). The reason for this is that this cache is not freed by cairo_debug_reset_static_data(). This commit wires up freeing the cache to cairo_debug_reset_static_data(). This cache was introduced in commit 615205cf0729 from 2012. Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-08bfo#91271 - Fix access of uninitialized memoryMassimo1-0/+3
Valgrind reports that xlib-render-compositor's composite_traps() accesses uninitialized memory when traps->num_traps == 0. This happens in the line that says if (xtraps[0].left.p1.y < xtraps[0].left.p2.y) { after the 'for' loop. We can actually return early if there are no trapezoids to render. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91271 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-03-08bfo#105084 - Initialize memory properly in ↵Federico Mena Quintero1-0/+3
_cairo_ft_font_face_create_for_pattern() The font_face->ft_options field was not being initialized, leading to an invalid free(). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=105084 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-03-07Add .gitlab-ci.yml to run the tests automaticallyFederico Mena Quintero1-0/+46
2018-02-28compiler-private: Define what PLT stands forBryce Harrington1-1/+1
2018-02-06win32: Fix a few typos in commentsBryce Harrington1-7/+7
2018-02-06win32: Whitespace cleanupBryce Harrington2-35/+35
2018-02-06win32: Fix multi-monitor virtual desktop with negative monitor coordsEric Hoffman2-4/+56
Under Win32, when you have a multiple-monitor setup, Windows creates a 'virtual desktop', which is a rectangle surface that extends across all monitors. The primary monitor always starts with the top-left corner at coordinate (0,0). If you have any other monitors which extend to the left or above the primary monitor, the virtual desktop's top-left corner will actually have coordinates which are negative. This creates an issue in Cairo with the desktop DC, i.e. when you use a DC from the function GetDC(NULL). The same thing can occur with other third party libraries like GTK, when you access the Cairo surface from the root window. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100793 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-02-06xml: Typo in commentBryce Harrington1-1/+1
2018-01-23font: Check return value from _cairo_ft_unscaled_font_lock_faceBryce Harrington1-2/+5
cairo-ft-font.c: In function ‘_cairo_ft_has_color_glyphs’: cairo-ft-font.c:3011:9: warning: ignoring return value of ‘_cairo_ft_unscaled_font_lock_face’, declared with attribute warn_unused_result [-Wunused-result] _cairo_ft_unscaled_font_lock_face (unscaled); ^
2018-01-23Fix two type casting warnings in get_C_locale()Bryce Harrington1-2/+2
cairo-misc.c:806:43: warning: passing argument 1 of ‘_cairo_atomic_ptr_get’ from incompatible pointer type C = (locale_t) _cairo_atomic_ptr_get (&C_locale); ^ cairo-misc.c:811:45: warning: passing argument 1 of ‘_cairo_atomic_ptr_cmpxchg_impl’ from incompatible pointer type if (!_cairo_atomic_ptr_cmpxchg (&C_locale, NULL, C)) { ^ Routines are expecting a void** so cast.
2018-01-22RELEASING: Refine devel version and taggingBryce Harrington1-5/+12
2018-01-19Fixup on previous commitBehdad Esfahbod1-0/+2