diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp b/Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp index 0f55f5797..61a0369f5 100644 --- a/Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp +++ b/Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp @@ -19,6 +19,8 @@ #include "config.h" #include "RefPtrCairo.h" +#if USE(CAIRO) + #include <cairo.h> #if USE(FREETYPE) @@ -30,89 +32,102 @@ namespace WTF { template<> void refIfNotNull(cairo_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_reference(ptr); } template<> void derefIfNotNull(cairo_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_destroy(ptr); } template<> void refIfNotNull(cairo_surface_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_surface_reference(ptr); } template<> void derefIfNotNull(cairo_surface_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_surface_destroy(ptr); } template<> void refIfNotNull(cairo_font_face_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_font_face_reference(ptr); } template<> void derefIfNotNull(cairo_font_face_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_font_face_destroy(ptr); } template<> void refIfNotNull(cairo_scaled_font_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_scaled_font_reference(ptr); } template<> void derefIfNotNull(cairo_scaled_font_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_scaled_font_destroy(ptr); } template<> void refIfNotNull(cairo_pattern_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_pattern_reference(ptr); } template<> void derefIfNotNull(cairo_pattern_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_pattern_destroy(ptr); } template<> void refIfNotNull(cairo_region_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_region_reference(ptr); } template<> void derefIfNotNull(cairo_region_t* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) cairo_region_destroy(ptr); } #if USE(FREETYPE) template<> void refIfNotNull(FcPattern* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) FcPatternReference(ptr); } template<> void derefIfNotNull(FcPattern* ptr) { - if (LIKELY(ptr != 0)) + if (LIKELY(ptr)) FcPatternDestroy(ptr); } -#endif +template<> void refIfNotNull(FcConfig* ptr) +{ + if (LIKELY(ptr)) + FcConfigReference(ptr); +} +template<> void derefIfNotNull(FcConfig* ptr) +{ + if (LIKELY(ptr)) + FcConfigDestroy(ptr); } +#endif + +} // namespace WTF + +#endif // USE(CAIRO) |