rom-properties/cmake/libs/FindCairo.cmake
David Korth 1c7be01a4a [gtk] Use Cairo for image handling with GTK+ 3.x.
Starting with GTK+ 3.10, GtkImage provides a function to set its image
from a Cairo surface. Cairo uses the same ARGB32 pixel format as
rp_image, so using a Cairo surface instead of a GdkPixbuf eliminates the
need to swap the R and B channels.

Consequently, there is no SSSE3 code for CairoImageConv, since we're
just doing a plain old memcpy().

PIMGTYPE.hpp: New header with a typedef PIMGTYPE, which is either
GdkPixbuf* or cairo_surface_t*, depending on GTK+ version. Also defines
RP_GTK_USE_CAIRO if using Cairo, and has wrapper functions for PIMGTYPE.

Updated CreateThumbnail and RomDataView to use PIMGTYPE where applicable.

TODO: CreateThumbnailPrivate::rescaleImgClass() is not currently
implemented for Cairo.
2018-06-03 13:45:17 -04:00

23 lines
653 B
CMake

# Find Cairo libraries and headers.
# If found, the following variables will be defined:
# - Cairo_FOUND: System has Cairo.
# - Cairo_INCLUDE_DIRS: Cairo include directories.
# - Cairo_LIBRARIES: Cairo libraries.
# - Cairo_DEFINITIONS: Compiler switches required for using Cairo.
#
# In addition, a target Cairo::cairo will be created with all of
# these definitions.
#
# References:
# - https://cmake.org/Wiki/CMake:How_To_Find_Libraries
# - http://francesco-cek.com/cmake-and-gtk-3-the-easy-way/
#
INCLUDE(FindLibraryPkgConfig)
FIND_LIBRARY_PKG_CONFIG(Cairo
cairo # pkgconfig
cairo.h # header
cairo # library
Cairo::cairo # imported target
)