Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #315 from kkoopa/master

Made CAIRO_FORMAT_RGB30 optional to support outdated versions of Cairo
  • Loading branch information...
commit dca6b01f9a05d9b2db76a91933c3a250319fe9a2 2 parents 6fe0483 + 8679132
@kangax kangax authored
Showing with 9 additions and 4 deletions.
  1. +6 −3 binding.gyp
  2. +3 −1 src/PNG.h
View
9 binding.gyp
@@ -36,7 +36,8 @@
'conditions': [
['OS=="win"', {
'libraries': [
- '-l<(GTK_Root)/lib/cairo.lib'
+ '-l<(GTK_Root)/lib/cairo.lib',
+ '-l<(GTK_Root)/lib/libpng.lib'
],
'include_dirs': [
'<(GTK_Root)/include',
@@ -48,10 +49,12 @@
}, { # 'OS!="win"'
'libraries': [
'<!@(pkg-config pixman-1 --libs)',
- '<!@(pkg-config cairo --libs)'
+ '<!@(pkg-config cairo --libs)',
+ '<!@(pkg-config libpng --libs)'
],
'include_dirs': [
- '<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)'
+ '<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',
+ '<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)'
]
}],
['with_freetype=="true"', {
View
4 src/PNG.h
@@ -2,7 +2,7 @@
#define _CANVAS_PNG_H
#include <png.h>
#include <pngconf.h>
-#include <cairo.h>
+#include <cairo/cairo.h>
#include <stdlib.h>
#include <string.h>
#include "closure.h"
@@ -137,10 +137,12 @@ static cairo_status_t canvas_write_png(cairo_surface_t *surface, png_rw_ptr writ
bpc = 8;
png_color_type = PNG_COLOR_TYPE_RGB_ALPHA;
break;
+#ifdef CAIRO_FORMAT_RGB30
case CAIRO_FORMAT_RGB30:
bpc = 10;
png_color_type = PNG_COLOR_TYPE_RGB;
break;
+#endif
case CAIRO_FORMAT_RGB24:
bpc = 8;
png_color_type = PNG_COLOR_TYPE_RGB;

1 comment on commit dca6b01

@andrewrk

please publish this change!

Please sign in to comment.
Something went wrong with that request. Please try again.