This happens when converting _cairo_status to _cairo_int_status:
warning C5286: implicit conversion from enum type '_cairo_int_status' to
enum type '_cairo_status'; use an explicit cast to silence this warning
They don't support C11 anyway. Additionally, CLang defines a very
conservative __GNUC__ value (which is also configurable via the
-fgnuc-version= command-line argument)
When cairo_is_all_clipped return true, we must not attempt
to change any of the clip fields, since it is pointing to
the static const __cairo_clip_all.
Moving the check for ->region into the 'if' is fine, since
it will always be NULL for _cairo_clip_all.
This was causing a crash in inkscape, see
https://gitlab.com/inkscape/inkscape/-/issues/5631
IDWriteGlyphRunAnalysis supports gray-scale antialiasing only when
created via IDWriteFactory2 (and newer), introduced in Windows 8.1
Fallback to using DIrect2D on A8 targets when IDWriteFactory2 is
not available.
This partially reverts commit ba4d5fbd5 from MR !343 which asked for
hidden symbols everywhere. cairo-fdr and cairo-trace explicitly try to
interpose existing symbols. Changing them to hidden symbols breaks these
tools.
See: https://gitlab.freedesktop.org/cairo/cairo/-/issues/882#note_2759005
Signed-off-by: Uli Schlachter <psychon@znc.in>
...by checking for IUnknown.
This makes GeometryRecorder::QueryInterface compliant with the
rules of COM.
QueryInterface for IUnknown has a special meaning in COM: it's
used to check whether two interface pointers refer to the same
object.
STDMETHOD / IFACEMETHOD macros already add __declspec(nothrow), but
noexcept is better. From MSDN [1]:
We recommend that all new code use the noexcept operator rather than
__declspec(nothrow).
This attribute tells the compiler that the declared function and the
functions it calls never throw an exception. However, it does not
enforce the directive. In other words, it never causes std::terminate
to be invoked, unlike noexcept, or in std:c++17 mode (Visual Studio
2017 version 15.5 and later), throw().
See also [2]:
Non-throwing functions are permitted to call potentially-throwing
functions. Whenever an exception is thrown and the search for a handler
encounters the outermost block of a non-throwing function, the function
std::terminate is called:
extern void f(); // potentially-throwing
void g() noexcept {
f(); // valid, even if f throws
throw 42; // valid, effectively a call to std::terminate
}
References:
[1] https://learn.microsoft.com/en-us/cpp/cpp/nothrow-cpp?view=msvc-170
[2] https://en.cppreference.com/w/cpp/language/noexcept_spec
IFACEMETHOD already adds the __override / __allowed(on_function) SAL
annotation (only on Windows SDK, not mingw-w64), which is understood
by some code analysis tools [1]. Since we're compiling in C++11 mode,
we can add the override specifier, so that the compiler is informed
as well.
[1] https://devblogs.microsoft.com/oldnewthing/20200911-00/?p=104205