cairo 1.15.2 → 1.15.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cairo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/NEWS +20 -0
- data/Rakefile +10 -18
- data/ext/cairo/extconf.rb +1 -0
- data/ext/cairo/rb_cairo.h +1 -1
- data/ext/cairo/rb_cairo_font_options.c +5 -1
- data/ext/cairo/rb_cairo_surface.c +32 -6
- data/test/test_font_options.rb +47 -2
- data/test/test_pdf_surface.rb +8 -0
- data/test/test_svg_surface.rb +8 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 423b5d3e45915806cef384e43a6ab18f29d3446f
|
4
|
+
data.tar.gz: b15dd8ad7d922e3f9fdf1e460fb961a3f5528fa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50099d9a793c264b629c0202db692bb60f03feacd169e04692223d115c17a763cb4a9649111e84f04dc229cdeb8ac63a3f9a69233b06b361d94d7b94a7c77ece
|
7
|
+
data.tar.gz: 6bf5a8b2ece952830ccd1180a34b8177b8a690806a672b77df701d068be041ac6bec26bf4c9ca8d8cc048a6d1e9e170a1bda3b35ed669861a4d05b3a1f302d82
|
data/NEWS
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
Release 1.15.3 (2016-11-15) Kouhei Sutou <kou@cozmixng.org>
|
2
|
+
===========================================================
|
3
|
+
|
4
|
+
Improvements
|
5
|
+
------------
|
6
|
+
|
7
|
+
* Changed Cairo::FontOptions#== behavior to value equality check
|
8
|
+
from object equality check.
|
9
|
+
* Windows: Supported Ruby 2.4.
|
10
|
+
* Windows: Updated bundled libpng.
|
11
|
+
* Windows: Updated bundled freetype.
|
12
|
+
* Windows: Updated bundled libxml.
|
13
|
+
* Windows: Updated bundled fontconfig.
|
14
|
+
* Windows: Updated bundled pixman.
|
15
|
+
* Made Cairo::ImageSurface GC friendly with Ruby 2.4.
|
16
|
+
* Cairo::SVGSurface: Accepted nil as filename.
|
17
|
+
[GitHub#43][Reported by Andy Meneely]
|
18
|
+
* Cairo::PSSurface: Accepted nil as filename.
|
19
|
+
* Cairo::PDFSurface: Accepted nil as filename.
|
20
|
+
|
1
21
|
Release 1.15.2 (2016-04-02) Kouhei Sutou <kou@cozmixng.org>
|
2
22
|
===========================================================
|
3
23
|
|
data/Rakefile
CHANGED
@@ -116,9 +116,9 @@ class Package < Struct.new(:name,
|
|
116
116
|
def download_site_base_url
|
117
117
|
case download_site
|
118
118
|
when :cairo
|
119
|
-
base_url = "
|
119
|
+
base_url = "https://cairographics.org/releases"
|
120
120
|
when :cairo_snapshots
|
121
|
-
base_url = "
|
121
|
+
base_url = "https://cairographics.org/snapshots"
|
122
122
|
when :gnome
|
123
123
|
base_url = "http://ftp.gnome.org/pub/gnome/sources"
|
124
124
|
release_series = version.gsub(/\A(\d+\.\d+).+\z/, '\1')
|
@@ -452,24 +452,24 @@ windows_task = WindowsTask.new(spec) do |task|
|
|
452
452
|
},
|
453
453
|
{
|
454
454
|
:name => "libpng",
|
455
|
-
:version => "1.6.
|
456
|
-
:download_base_url => "http://downloads.sourceforge.net/project/libpng/libpng16/1.6.
|
455
|
+
:version => "1.6.26",
|
456
|
+
:download_base_url => "http://downloads.sourceforge.net/project/libpng/libpng16/1.6.26",
|
457
457
|
:windows => {
|
458
458
|
:built_file => "bin/libpng16-16.dll",
|
459
459
|
},
|
460
460
|
},
|
461
461
|
{
|
462
462
|
:name => "freetype",
|
463
|
-
:version => "2.
|
464
|
-
:download_base_url => "http://downloads.sourceforge.net/project/freetype/freetype2/2.
|
463
|
+
:version => "2.7",
|
464
|
+
:download_base_url => "http://downloads.sourceforge.net/project/freetype/freetype2/2.7",
|
465
465
|
:compression_method => "bz2",
|
466
466
|
:windows => {
|
467
|
-
:built_file => "bin/libfreetype-
|
467
|
+
:built_file => "bin/libfreetype-7.dll",
|
468
468
|
},
|
469
469
|
},
|
470
470
|
{
|
471
471
|
:name => "libxml2",
|
472
|
-
:version => "2.9.
|
472
|
+
:version => "2.9.4",
|
473
473
|
:download_base_url => "ftp://xmlsoft.org/libxml2",
|
474
474
|
:compression_method => "gz",
|
475
475
|
:windows => {
|
@@ -477,15 +477,11 @@ windows_task = WindowsTask.new(spec) do |task|
|
|
477
477
|
:configure_args => [
|
478
478
|
"--without-python",
|
479
479
|
],
|
480
|
-
:patches => [
|
481
|
-
"remove-empty-z_dir-ldflags.diff",
|
482
|
-
],
|
483
|
-
:need_autoreconf => true,
|
484
480
|
},
|
485
481
|
},
|
486
482
|
{
|
487
483
|
:name => "fontconfig",
|
488
|
-
:version => "2.
|
484
|
+
:version => "2.12.1",
|
489
485
|
:download_base_url => "https://www.freedesktop.org/software/fontconfig/release",
|
490
486
|
:compression_method => "bz2",
|
491
487
|
:windows => {
|
@@ -494,15 +490,11 @@ windows_task = WindowsTask.new(spec) do |task|
|
|
494
490
|
"--enable-libxml2",
|
495
491
|
"--disable-docs",
|
496
492
|
],
|
497
|
-
:patches => [
|
498
|
-
"fontconfig-2.11.1-disable-mktemp-s.diff",
|
499
|
-
],
|
500
|
-
:need_autoreconf => true,
|
501
493
|
},
|
502
494
|
},
|
503
495
|
{
|
504
496
|
:name => "pixman",
|
505
|
-
:version => "0.
|
497
|
+
:version => "0.34.0",
|
506
498
|
:download_site => :cairo,
|
507
499
|
:compression_method => "gz",
|
508
500
|
:windows => {
|
data/ext/cairo/extconf.rb
CHANGED
@@ -208,6 +208,7 @@ $defs << "-DRB_CAIRO_COMPILATION"
|
|
208
208
|
have_header("ruby/st.h") unless have_macro("HAVE_RUBY_ST_H", "ruby.h")
|
209
209
|
have_header("ruby/io.h") unless have_macro("HAVE_RUBY_IO_H", "ruby.h")
|
210
210
|
have_func("rb_errinfo", "ruby.h")
|
211
|
+
have_func("rb_gc_adjust_memory_usage", "ruby.h")
|
211
212
|
have_type("enum ruby_value_type", "ruby.h")
|
212
213
|
|
213
214
|
create_makefile(module_name)
|
data/ext/cairo/rb_cairo.h
CHANGED
@@ -96,6 +96,9 @@ cr_options_merge (VALUE self, VALUE other)
|
|
96
96
|
static VALUE
|
97
97
|
cr_options_equal (VALUE self, VALUE other)
|
98
98
|
{
|
99
|
+
if (!rb_cairo__is_kind_of (other, rb_cCairo_FontOptions))
|
100
|
+
return Qfalse;
|
101
|
+
|
99
102
|
return CBOOL2RVAL (cairo_font_options_equal (_SELF (self), _SELF (other)));
|
100
103
|
}
|
101
104
|
|
@@ -168,12 +171,13 @@ Init_cairo_font_options (void)
|
|
168
171
|
rb_define_class_under (rb_mCairo, "FontOptions", rb_cObject);
|
169
172
|
|
170
173
|
rb_define_alloc_func (rb_cCairo_FontOptions, cr_options_allocate);
|
171
|
-
|
174
|
+
|
172
175
|
rb_define_method (rb_cCairo_FontOptions, "initialize", cr_options_create, 0);
|
173
176
|
|
174
177
|
rb_define_method (rb_cCairo_FontOptions, "dup", cr_options_copy, 0);
|
175
178
|
rb_define_method (rb_cCairo_FontOptions, "merge!", cr_options_merge, 1);
|
176
179
|
rb_define_alias (rb_cCairo_FontOptions, "update", "merge!");
|
180
|
+
rb_define_method (rb_cCairo_FontOptions, "==", cr_options_equal, 1);
|
177
181
|
rb_define_method (rb_cCairo_FontOptions, "eql?", cr_options_equal, 1);
|
178
182
|
rb_define_method (rb_cCairo_FontOptions, "hash", cr_options_hash, 0);
|
179
183
|
rb_define_method (rb_cCairo_FontOptions, "set_antialias",
|
@@ -349,6 +349,24 @@ cr_surface_xml_supported_p (VALUE klass)
|
|
349
349
|
#endif
|
350
350
|
}
|
351
351
|
|
352
|
+
static void
|
353
|
+
rb_cairo_surface_adjust_memory_usage (cairo_surface_t *surface,
|
354
|
+
cairo_bool_t new)
|
355
|
+
{
|
356
|
+
#ifdef HAVE_RB_GC_ADJUST_MEMORY_USAGE
|
357
|
+
if (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE)
|
358
|
+
{
|
359
|
+
ssize_t memory_usage_diff;
|
360
|
+
memory_usage_diff =
|
361
|
+
cairo_image_surface_get_stride (surface) *
|
362
|
+
cairo_image_surface_get_height (surface);
|
363
|
+
if (!new)
|
364
|
+
memory_usage_diff = -memory_usage_diff;
|
365
|
+
rb_gc_adjust_memory_usage (memory_usage_diff);
|
366
|
+
}
|
367
|
+
#endif
|
368
|
+
}
|
369
|
+
|
352
370
|
/* constructor/de-constructor */
|
353
371
|
cairo_surface_t *
|
354
372
|
rb_cairo_surface_from_ruby_object (VALUE obj)
|
@@ -381,8 +399,12 @@ cr_surface_free (void *ptr)
|
|
381
399
|
{
|
382
400
|
cairo_surface_t *surface = ptr;
|
383
401
|
|
384
|
-
if (surface)
|
385
|
-
|
402
|
+
if (!surface)
|
403
|
+
return;
|
404
|
+
|
405
|
+
rb_cairo_surface_adjust_memory_usage (surface, CR_FALSE);
|
406
|
+
|
407
|
+
cairo_surface_destroy (surface);
|
386
408
|
}
|
387
409
|
|
388
410
|
VALUE
|
@@ -393,6 +415,7 @@ rb_cairo_surface_to_ruby_object (cairo_surface_t *surface)
|
|
393
415
|
VALUE klass;
|
394
416
|
klass = cr_surface_get_klass (surface);
|
395
417
|
cairo_surface_reference (surface);
|
418
|
+
rb_cairo_surface_adjust_memory_usage (surface, CR_TRUE);
|
396
419
|
return Data_Wrap_Struct (klass, NULL, cr_surface_free, surface);
|
397
420
|
}
|
398
421
|
else
|
@@ -984,6 +1007,7 @@ cr_image_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
984
1007
|
|
985
1008
|
rb_cairo_surface_check_status (surface);
|
986
1009
|
DATA_PTR (self) = surface;
|
1010
|
+
rb_cairo_surface_adjust_memory_usage (surface, CR_TRUE);
|
987
1011
|
if (rb_block_given_p ())
|
988
1012
|
rb_cairo__surface_yield_and_finish (self);
|
989
1013
|
return Qnil;
|
@@ -1094,10 +1118,12 @@ cr_ ## type ## _surface_initialize (int argc, VALUE *argv, VALUE self) \
|
|
1094
1118
|
} \
|
1095
1119
|
else \
|
1096
1120
|
{ \
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1121
|
+
const char *filename = NULL; \
|
1122
|
+
if (!NIL_P (target)) \
|
1123
|
+
filename = StringValueCStr (target); \
|
1124
|
+
surface = cairo_ ## type ## _surface_create (filename, \
|
1125
|
+
width_in_points, \
|
1126
|
+
height_in_points); \
|
1101
1127
|
} \
|
1102
1128
|
\
|
1103
1129
|
rb_cairo_surface_check_status (surface); \
|
data/test/test_font_options.rb
CHANGED
@@ -7,7 +7,52 @@ class FontOptionsTest < Test::Unit::TestCase
|
|
7
7
|
@options = Cairo::FontOptions.new
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
sub_test_case "#==" do
|
11
|
+
test "not FontOptions" do
|
12
|
+
assert do
|
13
|
+
!(@options == nil)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
test "same object" do
|
18
|
+
assert do
|
19
|
+
@options == @options
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
test "same content" do
|
24
|
+
assert do
|
25
|
+
@options == @options.dup
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
sub_test_case "#eql? and #hash" do
|
31
|
+
test "not FontOptions" do
|
32
|
+
object = Object.new
|
33
|
+
options = @options
|
34
|
+
object.singleton_class.__send__(:define_method, :hash) do
|
35
|
+
options.hash
|
36
|
+
end
|
37
|
+
|
38
|
+
hash = {
|
39
|
+
object => :value,
|
40
|
+
}
|
41
|
+
assert_nil(hash[@options])
|
42
|
+
end
|
43
|
+
|
44
|
+
test "same object" do
|
45
|
+
hash = {
|
46
|
+
@options => :value,
|
47
|
+
}
|
48
|
+
assert_equal(:value, hash[@options])
|
49
|
+
end
|
50
|
+
|
51
|
+
test "same content" do
|
52
|
+
hash = {
|
53
|
+
@options => :value,
|
54
|
+
}
|
55
|
+
assert_equal(:value, hash[@options.dup])
|
56
|
+
end
|
12
57
|
end
|
13
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cairo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pkg-config
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- test/test_font_options.rb
|
163
163
|
- test/test_image_surface.rb
|
164
164
|
- test/test_paper.rb
|
165
|
+
- test/test_pdf_surface.rb
|
165
166
|
- test/test_quartz_image_surface.rb
|
166
167
|
- test/test_raster_source_pattern.rb
|
167
168
|
- test/test_recording_surface.rb
|
@@ -170,6 +171,7 @@ files:
|
|
170
171
|
- test/test_script_device.rb
|
171
172
|
- test/test_script_surface.rb
|
172
173
|
- test/test_surface.rb
|
174
|
+
- test/test_svg_surface.rb
|
173
175
|
- test/test_tee_surface.rb
|
174
176
|
- test/test_text_cluster.rb
|
175
177
|
- test/test_text_extents.rb
|
@@ -206,6 +208,7 @@ test_files:
|
|
206
208
|
- test/test_font_extents.rb
|
207
209
|
- test/test_scaled_font.rb
|
208
210
|
- test/test_paper.rb
|
211
|
+
- test/test_svg_surface.rb
|
209
212
|
- test/test_script_device.rb
|
210
213
|
- test/test_xml_device.rb
|
211
214
|
- test/cairo-test-utils.rb
|
@@ -222,8 +225,8 @@ test_files:
|
|
222
225
|
- test/test_color.rb
|
223
226
|
- test/test_constants.rb
|
224
227
|
- test/test_text_to_glyphs_data.rb
|
228
|
+
- test/test_pdf_surface.rb
|
225
229
|
- test/test_surface.rb
|
226
230
|
- test/test_exception.rb
|
227
231
|
- test/test_xml_surface.rb
|
228
232
|
- test/test_region.rb
|
229
|
-
has_rdoc:
|