Browse Source

Merge pull request #315 from kkoopa/master

Made CAIRO_FORMAT_RGB30 optional to support outdated versions of Cairo
v1.x
Juriy Zaytsev 11 years ago
parent
commit
dca6b01f9a
  1. 9
      binding.gyp
  2. 4
      src/PNG.h

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"', {

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;

Loading…
Cancel
Save