mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 17:30:19 +01:00
The rationale behind this change is that when someone is trying to draw on a SVG surface using image surface patterns, the resulting SVG file can take up to ridiculous 20 megabytes for 3-4 typical photographic images in a single SVG file. This also can take significant amount of CPU time to complete. The reason for this behaviour is that currently whenever SVG backend needs to emit an image tag for a surface pattern it takes a snapshot of the subject surface, encodes it in PNG, then Base64-encodes and emits the (huge) resulting string. With use of cairo_surface_set_mime_data API this can be somewhat improved by associating JPEG image contents with the corresponding surfaces. Still this doesn't allow for post-processing of involved photographic images without regenerating the SVG file. As SVG specification allows URIs in the image tag's xlink:href attribute, it is possible instead of embedding encoded image data to simply link image files residing physically on the same medium as the generated SVG file: files on disk under common directory, files on a web server at common base URI, etc. To make this happen we add new (unofficial) MIME type "text/x-uri" and let users associate URIs with surfaces through cairo_surface_set_mime_data() API. When SVG backend needs to emit surface contents and it sees "text/x-uri" attached to the surface, it emits this data instead of taking snapshot. The URI data is emitted as is, so correctness check is left solely to the client code. |
||
|---|---|---|
| .. | ||
| tmpl | ||
| .gitignore | ||
| cairo-docs.xml | ||
| cairo-overrides.txt | ||
| cairo-sections.txt | ||
| cairo.types | ||
| check-doc-coverage.sh | ||
| check-doc-syntax.sh | ||
| language-bindings.xml | ||
| Makefile.am | ||
| README | ||
Cairo Reference Documentation ============================= The API documentation is generated using gtk-doc. Building -------- The documentation is not built by default. To build it you need to configure with gtk-doc enabled (--enable-gtk-doc), and run: make doc Adding New API -------------- When adding new symbols and macros to the public API, modify cairo-section.txt and add new symbols to the right place. When adding whole new features, you also need to modify cairo-docs.xml and add a new file under tmpl/. Beware that the files are tmpl/ are both manually edited AND modified by gtk-doc, gathering documentation stub from source files. Tests ----- There are some tests in this directory, ensuring proper documentation syntax as well as checking that all public symbols are fully documented. After adding any new API, just run: make check