summaryrefslogtreecommitdiff
path: root/src/cairo-quartz-private.h
Commit message (Collapse)AuthorAgeFilesLines
* [quartz]Conditionally Use Main Display ColorSpace instead of ↵John Ralls2023-02-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [quartz] Pretty up the surface-type and zero-size tests.John Ralls2023-02-141-0/+2
|
* [quartz] Cleanup and make better use of cairo_quartz_image_surface_t.John Ralls2023-02-141-12/+6
| | | | | | | | | 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.
* [quartz] Convert font handling from CGFont to CTFont.John Ralls2022-04-241-0/+2
|
* Reimplement cairo-quartz-font with Core Text.John Ralls2022-04-241-0/+4
|
* [quartz] Don't use CGContextDrawTiledImage for tiled patterns.John Ralls2022-02-241-1/+0
| | | | | | | | | | | CGContextDrawTiledImage turned up as a significant time-user while profiling a benchmark created to evaluate https://gitlab.gnome.org/GNOME/gtk/-/issues/3714. Without this commit the benchmark is able to perform a mean frame rate of 2.19 frames per second with a standard deviation of 0.09; with the commit the mean frame rate is 2.37 fps, s.d. 0.30, both over 15 10-second samples. Student's t-test reports a 9.8% likelyhood that the two represent the same distribution.
* [quartz] Create similar surfaces using a CGLayer for faster drawing.John Ralls2022-02-241-1/+3
|
* [quartz] Remove cached image_surface on quartz surfaces.John Ralls2022-02-241-1/+2
| | | | | Caching doesn't really do anything and removing it provides a 50% speedup and gets pdf-operators-text to pass on argb32.
* quartz: Restore 10.4-specific font codeAndrea Canciani2017-01-181-4/+8
| | | | | | | | The code for extracting font glyphs was replaced in 70cc8f250b5669e757b4f044571ba0f71e3dea9e with an implementation based on CoreText, which is not available on MacOSX 10.4. This commit restores automatic detection of which API should be used by means of dynamic linking.
* quartz-image: Fix buildAndrea Canciani2014-10-031-0/+3
| | | | | | | | | The quartz-image backend uses _cairo_surface_is_quartz(), which therefore needs to be made available to it. Fixed as suggested by Bryce in the referenced bugreport. References: https://bugs.freedesktop.org/show_bug.cgi?id=84569 Signed-off-by: Andrea Canciani <ranma42@gmail.com>
* quartz: Do not export private functionsAndrea Canciani2012-01-151-3/+3
| | | | | Private functions must be marked cairo_private to avoid exporting them.
* quartz: Rename declaration of _cairo_quartz_create_cgimageJesse van den Kieboom2011-09-031-1/+1
| | | | | | | | | | | The function was renamed in 81efbc1847c4b9c08440d76bbc1636b21cac16d8 but the prototype was not updated. Silences the warning: cairo-quartz-surface.c:165: warning: no previous prototype for 'CairoQuartzCreateCGImage' Along with 0c620080afa892f7bb642cc90fb72aafbebad16d, fixes https://bugs.freedesktop.org/show_bug.cgi?id=40082
* Remove quartz-image extents.Jeff Muizelaar2011-04-211-1/+1
| | | | We never used the x,y portion of the extents so we might as well take it out.
* quartz: Move drawing state out of surfaceAndrea Canciani2010-10-131-12/+0
| | | | | | | | | | Some pattern types (gradients, surface patterns) require some temporary information to be stored as "graphic state", because it doesn't belong to CGContext. Previously all of this data was stored inside the surface during the drawing operations, now it's in a stack-allocated structure (of type cairo_quartz_drawing_state_t). Based on a patch by Robert O'Callahan <robert@ocallahan.org>. See https://bugzilla.mozilla.org/show_bug.cgi?id=522859
* quartz: Unify DO_SOLID and DO_PATTERNAndrea Canciani2010-10-131-3/+1
| | | | | | Both DO_SOLID and DO_PATTERN setup the underlying CGContext to directly use the chosen color/pattern when filling and stroking, thus require no additional drawing operations and can share the same drawing code.
* quartz: Set operator when setting up sourceAndrea Canciani2010-10-131-2/+0
| | | | | | | | Share some code between the drawing functions by saving the state and setting the operator when setting up the source and by restoring the state during teardown. Based on a patch by Robert O'Callahan <robert@ocallahan.org>. See https://bugzilla.mozilla.org/show_bug.cgi?id=522859
* quartz: Remove DO_NOTHING and DO_UNSUPPORTED actionsAndrea Canciani2010-10-131-0/+9
| | | | | | DO_NOTHING and DO_UNSUPPORTED are not actual actions and are better handled by returning an appropriate cairo_int_status_t (and falling back, if needed).
* quartz: Improve gradient consistencyAndrea Canciani2010-10-121-0/+1
| | | | | | | | | | | | By keeping "virtual extents", quartz surfaces now keep track of the extents where they want the gradients to be consistent. This works across various API for surface creation and editing: - cairo_surface_create_for_rectangle - cairo_surface_create_similar + cairo_surface_set_device_offset - cairo_push_group/cairo_pop_group This method does not use clip extents, so it also makes gradient rasterization independent of clip/path extents.
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* quartz: Define cairo_quartz_float_t and use instead of floatKristian Rietveld2010-04-041-0/+6
| | | | | | | On Mac OS 10.6 and newer cairo_quartz_float_t is defined to be a CGFloat, resolving issues with the 64-bit builds. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=25814
* Remove clip handling from generic surface layer.Chris Wilson2009-07-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling clip as part of the surface state, as opposed to being part of the operation state, is cumbersome and a hindrance to providing true proxy surface support. For example, the clip must be copied from the surface onto the fallback image, but this was forgotten causing undue hassle in each backend. Another example is the contortion the meta surface endures to ensure the clip is correctly recorded. By contrast passing the clip along with the operation is quite simple and enables us to write generic handlers for providing surface wrappers. (And in the future, we should be able to write more esoteric wrappers, e.g. automatic 2x FSAA, trivially.) In brief, instead of the surface automatically applying the clip before calling the backend, the backend can call into a generic helper to apply clipping. For raster surfaces, clip regions are handled automatically as part of the composite interface. For vector surfaces, a clip helper is introduced to replay and callback into an intersect_clip_path() function as necessary. Whilst this is not primarily a performance related change (the change should just move the computation of the clip from the moment it is applied by the user to the moment it is required by the backend), it is important to track any potential regression: ppc: Speedups ======== image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup ▌ image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup ▎ image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup ▏ image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup ▏ Slowdowns ========= image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown ▏
* Make sure feature macros are checked using #if, not #ifdef; add a test for itBehdad Esfahbod2008-09-201-6/+5
| | | | | This is more robust to cases where people want to assign 0 to those variables. (win32/alternate build systems, etc)
* Use #include "cairo-*." instead of #include <cairo-*.h>Behdad Esfahbod2008-06-231-1/+1
| | | | | The rule is simple: <x.h> for system / other project includes, "x.h" for local includes.
* [cgfont] Add start of CGFont font backend to replace ATSUIVladimir Vukicevic2008-04-011-0/+5
|
* [quartz] Rename ATSUI font to Quartz fontVladimir Vukicevic2008-03-171-11/+3
|
* [quartz] Correctly handle gradients with non-identity pattern transformVladimir Vukicevic2008-03-071-1/+2
| | | | Fixes http://bugs.freedesktop.org/show_bug.cgi?id=14248
* [quartz] Add quartz-image-surface typeVladimir Vukicevic2008-02-251-2/+29
|
* [quartz] Store the CGFontRef and reuse it for renderingVladimir Vukicevic2008-01-151-0/+3
| | | | | | Previously the CGFontRef was recreated each time in show_glyphs; this caused the font to get re-embedded in any PDF files that were being generated through Quartz.
* [Makefile.am] Add target sparse to run sparse static source code analyzerBehdad Esfahbod2007-08-221-1/+1
| | | | There are still some bits not quite working.
* [fixpt] Replace cairo_rectangle_int16_t with cairo_rectangle_int_tVladimir Vukicevic2007-07-181-1/+1
| | | | | Mostly s/cairo_rectangle_int16_t/cairo_rectangle_int_t/, as well as definitions to pick cairo_rectangle_int_t.
* [quartz] fix DO_IMAGEVladimir Vukicevic2007-06-081-1/+4
| | | | | | The implementation of DO_IMAGE leaks memory via a referenced surface, and wasn't applied for strokes and glyphs. This patch corrects those issues.
* [quartz] rename remaining nquartz symbols to quartz.Brian Ewins2007-03-061-3/+3
| | | | Renaming any nquartz symbols and files left to quartz.
* [quartz,atsui] separate the quartz surface and atsui font backendBrian Ewins2007-03-051-3/+5
| | | | | Make it possible to use the --enable-quartz and --enable-atsui independently. Quartz on its own will use the ft font backend.
* [quartz] Remove (disabled) support for rendering via AGL/CGGLVladimir Vukicevic2007-02-201-10/+0
|
* [quartz] rename NQUARTZ -> QUARTZ in definesVladimir Vukicevic2007-02-201-1/+3
|
* [quartz] Rename nquartz to quartzVladimir Vukicevic2007-02-201-8/+22
|
* [nquartz] Initial commit of native quartz surfaceVladimir Vukicevic2006-09-131-0/+9
| | | | | | Inital commit of Native Quartz surface. The main missing functionality is mask() support (which is just a noop right now, except for the simple solid-alpha case).
* Fix bogus cairo_rectangle_fixed_t to be cairo_rectangle_int16_t.Carl Worth2006-06-061-1/+1
| | | | | | This rectangle has regular integer values, not fixed-point values. So the old name was horribly wrong and misleading, (and yes I think it was even I that had suggested it).
* Rename cairo_rectangle_t to cairo_rectangle_fixed_t.Robert O'Callahan2006-05-041-1/+1
| | | | | | This is in preparation for a later function addition for extracting clip rectangles from a cairo_t, (which will add a public cairo_rectangle_t).
* Make the API more like Vlad's new API.#Anders Carlsson2006-04-111-1/+1
|
* Rework the quartz backend to not always hold an image but instead to create ↵Anders Carlsson2006-04-101-6/+2
| | | | it on demand.#
* Add cairo-quartz-private.hAnders Carlsson2006-01-101-0/+61
If the destination surface is a quartz surface, get the clip mask from it. Added. Keep a copy of the clip mask around. (_cairo_surface_is_quartz): New function which determines if a given surface is a quartz surface.