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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce8d108c3b58a948209183a2fb63c498731dbb51
4
- data.tar.gz: 0db2b2faff68e8af41bd09d08161b4ad8ba7faa5
3
+ metadata.gz: 423b5d3e45915806cef384e43a6ab18f29d3446f
4
+ data.tar.gz: b15dd8ad7d922e3f9fdf1e460fb961a3f5528fa4
5
5
  SHA512:
6
- metadata.gz: fd3b30e2edec6c2e4991cde704b111a85709740d6b69942af539f583b2835a200670fc1cd7715e8bb9c9e32b4f3460b154c9facb03009d9ab39110857eda0602
7
- data.tar.gz: 45d4bae75b757f75b3b676fb6c44e3be98a57f70af016f5dcb78ef1481f87256f56d50402c46a85de750556b466a7d14e4f946120905af66f99f827405243cac
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 = "http://cairographics.org/releases"
119
+ base_url = "https://cairographics.org/releases"
120
120
  when :cairo_snapshots
121
- base_url = "http://cairographics.org/snapshots"
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.21",
456
- :download_base_url => "http://downloads.sourceforge.net/project/libpng/libpng16/1.6.21",
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.6.3",
464
- :download_base_url => "http://downloads.sourceforge.net/project/freetype/freetype2/2.6.3",
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-6.dll",
467
+ :built_file => "bin/libfreetype-7.dll",
468
468
  },
469
469
  },
470
470
  {
471
471
  :name => "libxml2",
472
- :version => "2.9.2",
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.11.1",
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.32.6",
497
+ :version => "0.34.0",
506
498
  :download_site => :cairo,
507
499
  :compression_method => "gz",
508
500
  :windows => {
@@ -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)
@@ -73,7 +73,7 @@ RB_CAIRO_BEGIN_DECLS
73
73
 
74
74
  #define RB_CAIRO_VERSION_MAJOR 1
75
75
  #define RB_CAIRO_VERSION_MINOR 15
76
- #define RB_CAIRO_VERSION_MICRO 2
76
+ #define RB_CAIRO_VERSION_MICRO 3
77
77
 
78
78
  RB_CAIRO_VAR VALUE rb_mCairo;
79
79
  RB_CAIRO_VAR VALUE rb_cCairo_Context;
@@ -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
- cairo_surface_destroy (surface);
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
- surface = \
1098
- cairo_ ## type ## _surface_create (StringValueCStr (target), \
1099
- width_in_points, \
1100
- height_in_points); \
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); \
@@ -7,7 +7,52 @@ class FontOptionsTest < Test::Unit::TestCase
7
7
  @options = Cairo::FontOptions.new
8
8
  end
9
9
 
10
- def test_something
11
- # WRITE ME!
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
@@ -0,0 +1,8 @@
1
+ class PDFSurfaceTest < Test::Unit::TestCase
2
+ include CairoTestUtils
3
+
4
+ def test_new_with_nil_target
5
+ surface = Cairo::PDFSurface.new(nil, 10, 20)
6
+ surface.finish
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class SVGSurfaceTest < Test::Unit::TestCase
2
+ include CairoTestUtils
3
+
4
+ def test_new_with_nil_target
5
+ surface = Cairo::SVGSurface.new(nil, 10, 20)
6
+ surface.finish
7
+ end
8
+ 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.2
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-04-02 00:00:00.000000000 Z
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: