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.
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.
Fixescairo/cairo#569
* 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
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
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.
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.
Fixescairo/cairo#641
Now that FreeType 2.13.0 has been released with a stable COLRv1 API,
the meson configuration can be updated to enable COLRv1 when this
version is available.
Reuse the win32 font code to create a glyph mask for a dwrite font.
Renamed a function _compute_mask in cairo-win32-font.c to
_cairo_compute_glyph_mask.
Applying a transformation matrix to a glyph path after converting
floats to fixed point numbers caused caluculation errors. Apply the
transform before the conversion.
Fixescairo/cairo#611
The code is doing "if (!double_buf_equal () != 0)" which seems to be a
convoluted way to do "if (!double_buf_equal ())". Fixes:
../test/pattern-getters.c:153:6: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
if (!double_buf_equal (ctx, new_buf, expected_values,
^
../test/pattern-getters.c:153:6: note: add parentheses after the '!' to evaluate the comparison first
if (!double_buf_equal (ctx, new_buf, expected_values,
^
(
../test/pattern-getters.c:153:6: note: add parentheses around left hand side expression to silence this warning
if (!double_buf_equal (ctx, new_buf, expected_values,
^
(
../perf/cairo-perf-chart.c:232:4: warning: variable 'sum' is uninitialized when used here [-Wuninitialized]
sum += v/100;
^~~
../perf/cairo-perf-chart.c:142:43: note: initialize the variable 'sum' to silence this warning
double slow_sum = 0, fast_sum = 0, sum;
^
= 0.0
../src/cairo-pdf-surface.c:2505:9: warning: variable 'status' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (surface->base.status != CAIRO_STATUS_SUCCESS)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/cairo-pdf-surface.c:2573:9: note: uninitialized use occurs here
if (status == CAIRO_STATUS_SUCCESS)
^~~~~~
../src/cairo-pdf-surface.c:2505:5: note: remove the 'if' if its condition is always false
if (surface->base.status != CAIRO_STATUS_SUCCESS)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/cairo-pdf-surface.c:2497:5: note: variable 'status' is declared here
cairo_status_t status, status2;
^
A little history digging shows that we only ever had one caller of
_cairo_tee_surface_find_match. Commit 658cdc7c9a "Introduce
cairo_tee_surface_t" added this code to _cairo_surface_clone_similar():
if (src->type == CAIRO_SURFACE_TYPE_TEE) {
cairo_surface_t *match;
match = _cairo_tee_surface_find_match (src,
surface->backend,
content);
if (match != NULL)
src = match;
}
Then, two years later in 2011, commit af9fbd176b "Introduce a new compositor
architecture" removed _cairo_surface_clone_similar() and thus this code became
unused.
This commit drops this unused code.
Signed-off-by: Uli Schlachter <psychon@znc.in>
../test/cairo-test-runner.c:730:48: warning: parameter 'str' set but not used [-Wunused-but-set-parameter]
_has_required_ghostscript_version (const char *str)
Gtk-doc wants the header and code parameter names to match.
src/win32/cairo-dwrite-font.cpp:1484: warning: Parameter description for cairo_dwrite_font_face_set_rendering_params::params is not used from source code comment block.
src/win32/cairo-dwrite-font.cpp:1484: warning: Parameter description for cairo_dwrite_font_face_set_rendering_params::param is missing in source code comment block.