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.
We're using an EOL version of GTK; we know we are using deprecated API.
Until somebody shows up with a replacement, or until we drop the perf
widget, we should avoid unnecessary compiler warnings.
While it's possible to write C code in Python, it's better to actually
write Python code in Python.
Use regular expressions, instead of counting characters, to allow a
little bit more leeway when editing the cairo-version.h header file.
Use a context manager to handle the lifetime of a file object.
Use f-strings instead of the obsolete format() method.