Sha256: adbda4fcc3e6ed3ac417af17abd4cf29e04a132760d5fe6c2a29ac8615675144

Contents?: true

Size: 762 Bytes

Versions: 73

Compression:

Stored size: 762 Bytes

Contents

require 'cairo'

class ImageSurfaceTest < Test::Unit::TestCase
  include CairoTestUtils

  def test_cloned_data
    width = 10
    height = 10
    original_surface = Cairo::ImageSurface.new(:a1, width, height)

    original_data = original_surface.data
    cloned_data = original_data.clone

    cloned_surface = Cairo::ImageSurface.new(cloned_data,
                                             :a1, width, height,
                                             original_surface.stride)

    Cairo::Context.new(cloned_surface) do |context|
      context.set_source_rgb(255, 255, 255)
      context.scale(width, height)
      context.move_to(0, 0)
      context.line_to(1, 1)
      context.stroke
    end

    assert_not_equal(original_data, cloned_data)
  end
end

Version data entries

73 entries across 65 versions & 2 rubygems

Version Path
cairo-1.15.13-x64-mingw32 test/test_image_surface.rb
cairo-1.15.13-x86-mingw32 test/test_image_surface.rb
cairo-1.15.13 test/test_image_surface.rb
cairo-1.15.12-x64-mingw32 test/test_image_surface.rb
cairo-1.15.12-x86-mingw32 test/test_image_surface.rb
cairo-1.15.12 test/test_image_surface.rb
cairo-1.15.11-x64-mingw32 test/test_image_surface.rb
cairo-1.15.11-x86-mingw32 test/test_image_surface.rb
cairo-1.15.11 test/test_image_surface.rb
cairo-1.15.10-x86-mingw32 test/test_image_surface.rb
cairo-1.15.10-x64-mingw32 test/test_image_surface.rb
cairo-1.15.10 test/test_image_surface.rb
cairo-1.15.9-x64-mingw32 test/test_image_surface.rb
cairo-1.15.9 test/test_image_surface.rb
cairo-1.15.9-x86-mingw32 test/test_image_surface.rb
cairo-1.15.8-x86-mingw32 test/test_image_surface.rb
cairo-1.15.8-x64-mingw32 test/test_image_surface.rb
cairo-1.15.8 test/test_image_surface.rb
cairo-1.15.7-x64-mingw32 test/test_image_surface.rb
cairo-1.15.7-x86-mingw32 test/test_image_surface.rb