summaryrefslogtreecommitdiffstats
path: root/spec/helper.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-27 11:37:06 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-27 11:37:06 +0100
commit7603f4c0902bf5845c7e7654c3745f5519347c8b (patch)
treebd381bf3a7f04d2ee7ddd92111c35a03472c7ecf /spec/helper.rb
parent8c013976d73850718e75bbc93a03f3f016fc3ae8 (diff)
downloadffi-efl-7603f4c0902bf5845c7e7654c3745f5519347c8b.zip
ffi-efl-7603f4c0902bf5845c7e7654c3745f5519347c8b.tar.gz
use instance_eval instead of yield self.
- simplify and highlights initialization code - but shadows external scope variables
Diffstat (limited to 'spec/helper.rb')
-rw-r--r--spec/helper.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/helper.rb b/spec/helper.rb
index e641c92..9bfab78 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -9,10 +9,11 @@ def realize_evas
width = 300
height = 200
@pixels = FFI::MemoryPointer.new :int, width*height
- @e = Efl::Evas::REvas.new
- @e.output_method_set Efl::Evas::render_method_lookup("buffer")
- @e.output_viewport_set 0, 0, width, height
- @e.output_size_set width, height
+ @e = Efl::Evas::REvas.new do
+ output_method_set Efl::Evas::render_method_lookup("buffer")
+ output_viewport_set 0, 0, width, height
+ output_size_set width, height
+ end
einfo = Efl::Native::EngineInfoBufferStruct.new @e.engine_info
einfo[:info][:depth_type] = Efl::Evas::EVAS_ENGINE_BUFFER_DEPTH_ARGB32
einfo[:info][:dest_buffer] = @pixels