summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'issue-778' into 'master'HEADmasterAdrian Johnson2023-05-131-4/+5
|\ | | | | | | | | | | | | ft: don't use scaled_glyph->dev_private to store data Closes #778 See merge request cairo/cairo!476
| * ft: don't use scaled_glyph->dev_private to store dataAdrian Johnson2023-05-131-4/+5
|/ | | | | | It is also used by the xlib surface. Fixes #778
* Merge branch 'issue-777' into 'master'Adrian Johnson2023-04-301-9/+6
|\ | | | | | | | | | | | | Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined Closes #777 See merge request cairo/cairo!475
| * Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is ↵Adrian Johnson2023-04-301-9/+6
|/ | | | | | defined Fixes #777
* Merge branch 'issue-508' into 'master'Adrian Johnson2023-04-1841-492/+3053
|\ | | | | | | | | | | | | Fix cairo_tag_begin/end in groups Closes #508 See merge request cairo/cairo!463
| * pdf: Don't use snprintf() to print floatsAdrian Johnson2023-04-181-8/+16
| | | | | | | | It is not locale independent.
| * Make cairo_tag_begin/end work correctly in groupsAdrian Johnson2023-04-1839-485/+2891
| | | | | | | | Fixes #508
| * cairo-list-inline.h: fixes and documentationAdrian Johnson2023-04-162-7/+154
|/ | | | | | - Fix a bug in cairo_list_is_singular - Rename cairo_list_swap() to cairo_list_move_list() to better describe what it is doing.
* Merge branch 'issue-776' into 'master'Adrian Johnson2023-04-161-4/+4
|\ | | | | | | | | | | | | win32: InterlockedCompareExchange uses LONG Closes #776 See merge request cairo/cairo!472
| * win32: InterlockedCompareExchange uses LONGAdrian Johnson2023-04-131-4/+4
| | | | | | | | Fixes #776
* | Merge branch 'ci-windows-image-update' into 'master'Adrian Johnson2023-04-161-1/+9
|\ \ | |/ |/| | | | | ci: bump windows image to latest and add workflow rules See merge request cairo/cairo!473
| * ci: add some more workflow rulesTim-Philipp Müller2023-04-161-0/+8
| | | | | | | | cargo-culted from the ci-templates template.
| * ci: bump windows image to latestTim-Philipp Müller2023-04-161-1/+1
|/
* Merge branch 'riastradh-20220406-ctype-misuse' into 'master'Adrian Johnson2023-03-293-6/+6
|\ | | | | | | | | Avoid misuse of ctype(3) functions See merge request cairo/cairo!309
| * Avoid misuse of ctype(3) functionsTaylor R Campbell2023-03-293-6/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ctype(3) character classification and mapping functions have a peculiarly limited definition (C11, Sec. 7.4 `Character handling <ctype.h>', p. 200): `The header <ctype.h> declares several functions useful for classifying and mapping characters. In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall equal the value of the macro EOF. If the argument has any other value, the behavior is undefined.' In other words, in the most common case of 8-bit char and EOF = -1, the domain of the 257 allowed arguments is: -1, 0, 1, 2, ..., 254, 255 The ctype(3) functions are designed for use with stdio functions like getchar and fgetc which return int values in the same domain. In an ABI where char is signed (e.g., x86 SysV ABI used by most Unixish operating systems), passing an argument of type char as is can go wrong in two ways: 1. The value of a non-EOF input octet interpreted as `char' may coincide, as an integer, with the value of EOF, leading to wrong answers for some non-EOF inputs. E.g., if EOF = 1, and an input octet has all bits set, i.e., 255 as an unsigned char, then as a char the value is -1, which will be confused with EOF. In the ISO-8859-1 locale, the code point 255 is (in Unicode terminology) LATIN SMALL LETTER Y WITH DIAERESIS, for which isprint, isalpha, &c., are true. But isprint, isalpha, &c., are false for EOF. So if char *s points to a string with that character, isprint(*s) will return false when it should return true. 2. Passing a negative char whose value does not coincide with EOF is undefined behaviour. This isn't purely theoretical: often the functions are implemented by an array lookup, #define isprint(c) (ctypetab[c] & ISPRINT). If c is out of range (e.g., 192, ISO-8859-1 for LATIN CAPITAL LETTER A WITH GRAVE, which convers to (signed) char as -64), then you can get garbage answers by reading uninitialized memory or application crashes with SIGSEGV if the page preceding the table is unmapped. If what you have is an arbitrary char (e.g., from a char * string pointing at user input), then the only correct way to use the ctype(3) functions is by converting to unsigned char first -- e.g., isprint((unsigned char)*s). (If the functions were defined as macros that convert to unsigned char first, they would then spuriously interpret EOF as a non-EOF, so they can't do that themselves.) It is possible, in some cases, to prove that the input always actually lies in {0, 1, 2, ..., 127}, so the conversion to unsigned char is not necessary. I didn't check whether this was the case -- it's safer to just adopt the habit of always casting char to unsigned char first before using the ctype(3) macros, which satisfies a compiler warning on some systems designed to detect this class of application errors at compile-time.
* Merge branch 'patch-1' into 'master'Uli Schlachter2023-03-261-88/+0
|\ | | | | | | | | Delete cairo/perf/make-html.py See merge request cairo/cairo!448
| * Delete cairo/perf/make-html.py Christian Clauss2023-02-051-88/+0
| | | | | | | | | | | | | | This file has not been updated in 13 years and does not correspond to the current implementation of cairo perf. The code is in Python 2 and will generate syntax errors on current versions of Python. See !7 and !357
* | Merge branch 'gi-text-glyphs' into 'master'Emmanuele Bassi2023-03-102-0/+14
|\ \ | | | | | | | | | | | | [gobject] Bind cairo_glyph_t and cairo_text_cluster_t See merge request cairo/cairo!468
| * | [gobject] Bind cairo_glyph_t and cairo_text_cluster_tBehdad Esfahbod2023-03-092-0/+14
|/ /
* | Merge branch 'issue-643' into 'master'Adrian Johnson2023-03-071-1/+16
|\ \ | | | | | | | | | | | | | | | | | | Fix missing glyphs in ft-font Closes #643 See merge request cairo/cairo!467
| * | ft: Use normal font size when detecting the formatAdrian Johnson2023-03-071-1/+16
| | | | | | | | | | | | | | | | | | The format may depend on the font size. Fixes #643
* | | Merge branch 'unused-function' into 'master'Uli Schlachter2023-03-036-75/+6
|\ \ \ | | | | | | | | | | | | | | | | Fix -Wunused-function warnings See merge request cairo/cairo!449
| * | | Fix -Wunused-function warningsKhaled Hosny2023-02-066-75/+6
| | | |
* | | | Merge branch 'ofz46165' into 'master'Uli Schlachter2023-03-031-1/+6
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | ofz#46165 avoid a divide by zero seen fuzzing libreoffice rendering See merge request cairo/cairo!351
| * | | ofz#46165 avoid a divide by zero seen fuzzing libreoffice renderingCaolán McNamara2022-08-311-1/+6
| | | |
* | | | Merge branch 'issue-3-win32-font-scale' into 'master'Adrian Johnson2023-03-021-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | win32 font is very small if the lfHeight of HFONT is exactly -size Closes #3 See merge request cairo/cairo!466
| * | | | win32 font is very small if the lfHeight of HFONT is exactly -sizeFujii Hironori2023-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cairo_win32_font_face_create_for_hfont is reusing the HFONT object passed by an argument if possible to create a scaled font. However, the condition was wrong. It checked the font matrix scale factor is `-lfHeight`. But it should be `-lfHeight * WIN32_FONT_LOGICAL_SCALE`. Fixes cairo/cairo#3
* | | | | Merge branch 'drop-xml-surface' into 'master'Emmanuele Bassi2023-03-029-1643/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | Remove XML surface See merge request cairo/cairo!446
| * | | | Remove XML surfaceEmmanuele Bassi2023-02-049-1643/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the Debian code search tool, nothing uses it as part of the Cairo public API, and it has been disabled for a long time with nobody complaining about it.
* | | | | Merge branch 'dont-free-nonheap-object' into 'master'Adrian Johnson2023-03-011-1/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Open-code bbtree_del to avoid free()ing a non-allocated object Closes #645 See merge request cairo/cairo!465
| * | | | | Open-code bbtree_del to avoid free()ing a non-allocated objectMatt Turner2023-03-011-1/+4
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we do already in _cairo_recording_surface_finish. Otherwise, the cleanup path of _cairo_recording_surface_create_bbtree() could call free() on surface->bbtree which is not dynamically allocated. Closes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/645
* | | | | Merge branch 'dwrite-clip-glyphs' into 'master'Adrian Johnson2023-03-011-9/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWrite: region clipping didn't work on win32 surfaces Closes #641 See merge request cairo/cairo!464
| * | | | | DWrite: region clipping didn't work on win32 surfacesFujii Hironori2023-03-011-9/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following clipping text tests of win32/rgb24 target were visibly failing because clipping didn't work. * clip-text * partial-clip-text-bottom * partial-clip-text-left * partial-clip-text-right * partial-clip-text-top _cairo_win32_gdi_compositor_glyphs sets the clip. However, _cairo_dwrite_show_glyphs_on_surface unset it. Fixes cairo/cairo#641
* | | | | Merge branch 'dwrite-a8-glyph-mask' into 'master'Adrian Johnson2023-02-274-180/+167
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DWrite: Support antialias and subpixel order font options See merge request cairo/cairo!460
| * | | | | DWrite: Support antialias and subpixel order font optionsFujii Hironori2023-02-272-15/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new IDWriteRenderingParams object from the given font options.
| * | | | | Change the workaround of MinGW dwrite_3.h problemFujii Hironori2023-02-274-165/+22
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DWRITE_COLOR_GLYPH_RUN1 struct definition of the old MinGW dwrite_3.h was invalid. To work around the problem, dw-extra.h defined the correct struct definition and all necessary API from dwrite_3.h. This approach needed to redefine all necessary API. This change added DWRITE_COLOR_GLYPH_RUN1_WORKAROUND struct and use it for IDWriteColorGlyphRunEnumerator1::GetCurrentRun.
* | | | | Merge branch 'issue-569-dwrite-inflate-glyph-bounds' into 'master'Adrian Johnson2023-02-201-4/+9
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWrite: Inflate glyph bounds 1px vertically too Closes #569 See merge request cairo/cairo!461
| * | | | | DWrite: Inflate glyph bounds 1px vertically tooFujii Hironori2023-02-201-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most top and bottom lines of glyphs were clipped in some fonts and conditions. The glyph bounds were inflated 1px horizontally. It should inflate vertically too. Fixes cairo/cairo#569
* | | | | | Merge branch 'fix-doc-for-cairo_matrix_transform_distance' into 'master'Adrian Johnson2023-02-201-7/+2
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | Fix cairo_matrix_transform_distance documentation See merge request cairo/cairo!462
| * | | | | Fix cairo_matrix_transform_distance documentationFujii Hironori2023-02-181-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use dx and dy instead of dx1 and dy1 to match with the arguments * Use dx_new and dy_new instead of dx2 and dy2 to match with other parts of the documentation * Use xx, yx, xy, yy instead of a, b, c, d to match with other parts of the documentation * Remove the last two sentences that doesn't make sense
* | | | | | Merge branch 'quartz-colorspace' into 'master'Uli Schlachter2023-02-184-55/+149
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better color management for improved performance on some apps. Closes #330 See merge request cairo/cairo!290
| * | | | | [quartz]Conditionally Use Main Display ColorSpace instead of ↵John Ralls2023-02-174-55/+149
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kCGColorSpaceDefaultRGB. The default RGB colorspace must be converted to the GPU's colorspace using CGColorTransformConvertUsingCMSConverter. Profiling has shown this function to consume as much as 48% of a redraw cycle in gdk-quartz. There seems to be no named colorspace that matches the one stored on the display, so we use the one associated with the main display. This has some risks for users with multiple monitors but in testing with my own two-monitor setup, one of which is HDR and the other not, the colorspace was the same for both. This is applied to quartz surfaces created with cairo_quartz_surface_create(); surfaces created with cairo_quartz_surface_create_for_cg_context will inherit the colorspace from the context. In order to generate PNGs that look right I've converted the existing debugging functions for writing a quartz surface to png into private functions and wired cairo-boilerplate-quartz to use them. Using the generic cairo routine produced washed-out PNGs. Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/330
* | | | | Merge branch 'quartz-image-surface' into 'master'Uli Schlachter2023-02-176-280/+150
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | [quartz] Cleanup and make better use of cairo_quartz_image_surface_t. See merge request cairo/cairo!317
| * | | | | [quartz] Replace surface-pattern xfail with latest CI fail image.John Ralls2023-02-141-0/+0
| | | | | |
| * | | | | [quartz] Pretty up the surface-type and zero-size tests.John Ralls2023-02-143-22/+33
| | | | | |
| * | | | | [quartz] Cleanup and make better use of cairo_quartz_image_surface_t.John Ralls2023-02-145-276/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a CGBitmapContext mapping the underlying image surface's data instead of maintaining a CGImage. Generalize the quartz surface snapshot mechanism to work with both cairo_quartz_surface_t and cairo_quartz_image_surface_t and to use the latter to get a CGContext around non-quartz surfaces. Use this snapshot machanism to get a CGImageRef when needed from a cairo_quartz_image_surface_t.
* | | | | | Merge branch 'issue-641-glyph-bounds' into 'master'Adrian Johnson2023-02-161-99/+31
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWrite: clipped glyphs in win32 compositor Closes #641 See merge request cairo/cairo!459
| * | | | | | DWrite: clipped glyphs in win32 compositorFujii Hironori2023-02-141-99/+31
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The win32 compositor is using _cairo_dwrite_show_glyphs_on_surface for DWrite. It was assuming that a glyph was painted inside 3x3 of the em square. It should take the actual glyph bounding box by using GetAlphaTextureBounds. Fixes cairo/cairo#641
* | | | | | Merge branch 'dwrite-glyph-phase' into 'master'Adrian Johnson2023-02-161-16/+6
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWrite: glyph surfaces should take subpixel positions into account Closes #597 See merge request cairo/cairo!456
| * | | | | DWrite: glyph surfaces should take subpixel positions into accountFujii Hironori2023-02-101-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shift the glyph position by phases taken by _cairo_scaled_glyph_xphase and _cairo_scaled_glyph_yphase. Fixes #597