[cairo-commit] 2 commits - build/configure.ac.warnings build/Makefile.win32.common src/cairo-qt-surface.cpp

Bryce Harrington bryce at kemper.freedesktop.org
Thu Sep 11 13:07:50 PDT 2014


 build/Makefile.win32.common |   23 +++++++++++++++++------
 build/configure.ac.warnings |   13 +++++++------
 src/cairo-qt-surface.cpp    |    9 ++++++---
 3 files changed, 30 insertions(+), 15 deletions(-)

New commits:
commit e77d0a5611fedce2bfa0940ff62f003c1f9cfa08
Author: David Weiß <david.weiss at ptvgroup.com>
Date:   Fri Sep 5 17:03:26 2014 +0200

    made paths to pixman, libpng and zlib configurable by commandline for win32 builds
    
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common
index 01a38cd..7d7e973 100644
--- a/build/Makefile.win32.common
+++ b/build/Makefile.win32.common
@@ -23,18 +23,29 @@ CFG_CFLAGS := -MD -O2
 CFG_LDFLAGS :=
 endif
 
-PIXMAN_CFLAGS := -I$(top_srcdir)/../pixman/pixman
-PIXMAN_LIBS := $(top_builddir)/../pixman/pixman/$(CFG)/pixman-1.lib
+ifeq ($(PIXMAN_PATH),)
+PIXMAN_PATH := $(top_builddir)/../pixman
+endif
+PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/pixman/
+PIXMAN_LIBS := $(PIXMAN_PATH)/pixman/$(CFG)/pixman-1.lib
 
 CAIRO_LIBS =  gdi32.lib msimg32.lib user32.lib
+
 ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
-LIBPNG_CFLAGS += -I$(top_srcdir)/../libpng/
-CAIRO_LIBS +=  $(top_builddir)/../libpng/libpng.lib
+ifeq ($(LIBPNG_PATH),)
+LIBPNG_PATH := $(top_builddir)/../libpng
+endif
+LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/
+CAIRO_LIBS +=  $(LIBPNG_PATH)/libpng.lib
 endif
+
 ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00)
 else
-ZLIB_CFLAGS += -I$(top_srcdir)/../zlib/
-CAIRO_LIBS += $(top_builddir)/../zlib/zdll.lib
+ifeq ($(ZLIB_PATH),)
+ZLIB_PATH := $(top_builddir)/../zlib
+endif
+ZLIB_CFLAGS += -I$(ZLIB_PATH)/
+CAIRO_LIBS += $(ZLIB_PATH)/zdll.lib
 endif
 
 DEFAULT_CFLAGS = -nologo $(CFG_CFLAGS)
commit 3b9d7e583f376413df655f778a3ef04537e8a5b6
Author: Ravi Nanjundappa <nravi.n at samsung.com>
Date:   Fri Sep 5 12:15:02 2014 +0530

    qt: Suppress warnings in qt backend build
    
    This patch fixes majorly 2 kinds of warning issues:
    
    (1)
    cc1plus: warning: command line option '-Wold-style-definition' is valid for Ada/C/ObjC but not for C++ [enabled by default]
    cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default]
    cc1plus: warning: command line option '-Wnested-externs' is valid for C/ObjC but not for C++ [enabled by default]
    cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
    cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
    cc1plus: warning: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [enabled by default]
    
    Solution: Enable these warnings only for C compiler and not for C++
    
    (2)
    cairo-qt-surface.cpp: In function 'cairo_int_status_t _cairo_qt_surface_fill(void*, cairo_operator_t, const cairo_pattern_t*, const cairo_path_fixed_t*, cairo_fill_rule_t, double, cairo_antialias_t, const cairo_clip_t*)':
    cairo-qt-surface.cpp:852:5: warning: inlining failed in call to 'PatternToBrushConverter::PatternToBrushConverter(const cairo_pattern_t*)': --param max-inline-insns-single limit reached [-Winline]
    cairo-qt-surface.cpp:1339:38: warning: called from here [-Winline]
    cairo-qt-surface.cpp:390:1: warning: inlining failed in call to 'QPainterPath _ZL10path_to_qtPK17_cairo_path_fixedPK13_cairo_matrix.part.13()': call is unlikely and code size would grow [-Winline]
    cairo-qt-surface.cpp:1306:1: warning: called from here [-Winline]
    cairo-qt-surface.cpp:1051:5: warning: inlining failed in call to 'PatternToBrushConverter::~PatternToBrushConverter()': call is unlikely and code size would grow [-Winline]
    
    Solution: Add __attribute__ ((noinline)) to the function as mentioned in
    http://stackoverflow.com/questions/11724235/warning-for-template-with-g-o2-or-os-o-o1 (Edit 3)
    
    Signed-off-by: Ravi Nanjundappa <nravi.n at samsung.com>
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/build/configure.ac.warnings b/build/configure.ac.warnings
index 2c4e34d..74e6634 100644
--- a/build/configure.ac.warnings
+++ b/build/configure.ac.warnings
@@ -11,16 +11,17 @@ dnl MAYBE_WARN in an ignorable way (like adding whitespace)
 # -Wlogical-op causes too much noise from strcmp("literal", str)
 
 MAYBE_WARN="-Wall -Wextra \
--Wold-style-definition -Wdeclaration-after-statement \
 -Wmissing-declarations -Werror-implicit-function-declaration \
--Wnested-externs -Wpointer-arith -Wwrite-strings \
--Wsign-compare -Wstrict-prototypes -Wmissing-prototypes \
--Wpacked -Wswitch-enum -Wmissing-format-attribute \
--Wbad-function-cast -Wvolatile-register-var \
+-Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked
+-Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var \
 -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
 -Wno-missing-field-initializers -Wno-unused-parameter \
 -Wno-attributes -Wno-long-long -Winline"
 
+MAYBE_C_SPECIFIC_WARN="-Wold-style-definition \
+-Wdeclaration-after-statement -Wstrict-prototypes \
+-Wmissing-prototypes -Wbad-function-cast -Wnested-externs"
+
 # New -Wno options should be added here
 # gcc-4.4 and later accept every -Wno- option but may complain later that this
 # option is unknow each time another warning happen.
@@ -66,7 +67,7 @@ AC_CACHE_CHECK([for supported warning flags], cairo_cv_warn_cflags, [
 		CAIRO_CC_TRY_FLAG([-W$W -Wno-$W],, [WARN_CFLAGS="$WARN_CFLAGS -Wno-$W"])
 	done
 	cairo_cv_warn_cflags=$WARN_CFLAGS
-	cairo_cv_warn_maybe=$MAYBE_WARN
+	cairo_cv_warn_maybe="$MAYBE_WARN $MAYBE_C_SPECIFIC_WARN"
 
 	AC_MSG_CHECKING([which warning flags were supported])
 ])
diff --git a/src/cairo-qt-surface.cpp b/src/cairo-qt-surface.cpp
index ce05dba..8a91984 100644
--- a/src/cairo-qt-surface.cpp
+++ b/src/cairo-qt-surface.cpp
@@ -306,6 +306,8 @@ _qimage_format_from_cairo_format (cairo_format_t fmt)
 #else
         return QImage::Format_MonoLSB;
 #endif
+    case CAIRO_FORMAT_RGB30:
+        return QImage::Format_Mono;
     }
 
     return QImage::Format_Mono;
@@ -386,7 +388,7 @@ _cairo_path_to_qpainterpath_close_path (void *closure)
     return CAIRO_STATUS_SUCCESS;
 }
 
-static inline QPainterPath
+static QPainterPath
 path_to_qt (const cairo_path_fixed_t *path,
 	    const cairo_matrix_t *ctm_inverse = NULL)
 {
@@ -849,7 +851,8 @@ _cairo_qt_surface_set_clip (cairo_qt_surface_t *qs,
  */
 
 struct PatternToBrushConverter {
-    PatternToBrushConverter (const cairo_pattern_t *pattern) :
+    PatternToBrushConverter (const cairo_pattern_t *pattern)
+    __attribute__ ((noinline)) :
 	mAcquiredImageParent(0),
 	mAcquiredImage(0),
 	mAcquiredImageExtra(0)
@@ -1048,7 +1051,7 @@ struct PatternToBrushConverter {
 	}
     }
 
-    ~PatternToBrushConverter () {
+    ~PatternToBrushConverter () __attribute__ ((noinline)){
 	if (mAcquiredImageParent)
 	    _cairo_surface_release_source_image (mAcquiredImageParent, mAcquiredImage, mAcquiredImageExtra);
     }


More information about the cairo-commit mailing list