Re: [clutter] Problem migrating from 1.0.10 to 1.2.8

2010-06-08 Thread Emmanuele Bassi
On Mon, 2010-06-07 at 17:04 -0700, Kevin Cote wrote:

 I have an application that I have developed over the last 6 months on
 top of v1.0.10.  I am now trying to migrate this app to v1.2.8.  I
 have tried running the migrated app under Ubuntu 9.0.4 and also Moblin
 v2.  I get the same issues in both cases.  My symptoms are twofold:
 
 - Text is garbled.  By this I mean that each character is
 drawn almost like a block instead of the actual glyph.

which GPU and driver are you using?

 - Certain textures are not rendered (meaning I don’t see
 them), yet the app functions as if they are there (meaning if the
 texture is a button control the button still functions even though it
 is invisible).

again, these two seem connected (lack of mipmapping support).

 I tried executing some of the test-interactive programs and have seen
 two issues with v1.2.8.  These issues don’t exist in v1.0.10:
 
 1)  With the test-texture-async I get the following output in the
 console and see no output to the application window.

this has nothing to do with the rest of the issues; you have to pass a
file to the test otherwise it'll fail. I'll add a check that bails out
early instead of spewing errors.

 2)  With the test-texture-quality application I see the hand drawn
 properly on the first cycle, but for all other cycles, only a few
 pixels near the top are drawn.

there you go: lack of mipmapping support on your platform.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi, Open Source Software Engineer
Intel Open Source Technology Center

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



[clutter] RFC: Are toggle references needed for CoglHandle ?

2010-06-08 Thread Neil Roberts
Hi

I've started looking at the Ruby bindings for Clutter and I was
wondering about how best to bind CoglHandles. Currently they are just
wrapped as a boxed type. This has the effect that every time you query a
property that is a CoglHandle then the result appears as a completely
new object to the eyes of the interpreter. For example:

# This creates a new ClutterTexture
irb(main):003:0 tex = Clutter::Texture.new(redhand.png)
= #Clutter::Texture:0x86070c0 ptr=0x86580a8

# This queries the 'cogl_texture' property which returns the boxed
# CoglHandle.
irb(main):005:0 handle1 = tex.cogl_texture
= #Cogl::Texture:0x85d8190 ptr=0x8649db8 own=true

# If we query it a second time we can see that we've got a different
# object
irb(main):006:0 handle2 = tex.cogl_texture
= #Cogl::Texture:0x85d4610 ptr=0x8649db8 own=true
irb(main):008:0 handle1.object_id
= 70172872
irb(main):009:0 handle2.object_id
= 70165256

This isn't a major problem but it does mean that you can't attach data
to the Ruby object or subclass it and expect it to survive if you set it
as a property. Eg:

# Create a new Cogl texture
irb(main):010:0 handle = Cogl::Texture.new(redhand.png)
= #Cogl::Texture:0x85c574c ptr=0x86400b8 own=true

# Set some data on it
irb(main):021:0 handle.instance_variable_set(:@some_data, [1,2,3])
= [1, 2, 3]

# Put it in the ClutterTexture
irb(main):023:0 tex.cogl_texture = handle
= #Cogl::Texture:0x85c574c ptr=0x86400b8 own=true

# If we query it back out then the data is lost
irb(main):024:0 tex.cogl_texture.instance_variable_get(:@some_data)
= nil

Recently Cogl in git has gained support for attaching arbitrary user
data to any handle using a pointer as a key in much the same way as
Cairo does. We could use this to attach the Ruby proxy object to the
handle so that it could return the same object every time the handle is
seen. However if we do this then we need to resolve the issue that both
the proxy object and the GObject will need to reference each other yet
we still want them to be garbage collected. Most languages that bind
GObject seem to use toggle references to fix this. So my question is,
should we add toggle reference support to CoglHandles?

I think for languages with a mark-sweep garbage collector (like Ruby) we
could get away without toggle references if the reference count on the
handle was publicly visible. I would imagine you would then need to
store a list of all GObjects that Ruby has ever seen and then during the
mark phase you simply need to walk the list and mark any objects that
have a ref count  1 (meaning something in GLib-land is also using the
object). However my hunch is that this isn't sufficient for languages
that use ref-counting for their own garbage collection because then
there'd be no equivalent of the mark phase.

CoglHandles are pretty similar to GstMiniObjects and cairo's object
system as far as I can tell. How is binding handled for those? As far as
I can tell for cairo Python just creates a new wrapper object each time:

 surface = cairo.SVGSurface('out.svg', 100, 100)
 cr = cairo.Context(surface)
 source1 = cr.get_source()
 source2 = cr.get_source()
 id(source1)
3078983840L
 id(source2)
3078983856L

Ruby seems to use Cairo's user data retain the proxy object, but looking
at the code I can't work out why this doesn't cause a leak (maybe it
does).

irb(main):002:0 surface = Cairo::SVGSurface.new('out.svg', 100, 100)
= #Cairo::SVGSurface:0xb764ce4c
irb(main):003:0 cr = Cairo::Context.new(surface)
= #Cairo::Context:0xb764a228
irb(main):004:0 source1 = cr.source
= #Cairo::SolidPattern:0xb7648270
irb(main):005:0 source2 = cr.source
= #Cairo::SolidPattern:0xb7648270
irb(main):006:0 source1.object_id
= -609074888
irb(main):007:0 source2.object_id
= -609074888

Both cairo and GstMiniObject publicly expose the ref count. Would this
be enough for bindings?

Any help is much appreciated.

Regards,
- Neil
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



RE: [clutter] Problem migrating from 1.0.10 to 1.2.8

2010-06-08 Thread Kevin Cote

-Original Message-
From: Emmanuele Bassi [mailto:eba...@linux.intel.com]
Sent: Tuesday, June 08, 2010 3:13 AM
To: clutter@o-hand.com
Subject: Re: [clutter] Problem migrating from 1.0.10 to 1.2.8

On Mon, 2010-06-07 at 17:04 -0700, Kevin Cote wrote:

 I have an application that I have developed over the last 6 months on
 top of v1.0.10.  I am now trying to migrate this app to v1.2.8.  I
 have tried running the migrated app under Ubuntu 9.0.4 and also
 Moblin v2.  I get the same issues in both cases.  My symptoms are twofold:

 - Text is garbled.  By this I mean that each character is
 drawn almost like a block instead of the actual glyph.

which GPU and driver are you using?

Moblin is running on a 1.6GHz Atom with a US15W (Poulsbo) GPU.  I am running 
with the IEGD driver, v10.2.


 - Certain textures are not rendered (meaning I don’t see
 them), yet the app functions as if they are there (meaning if the
 texture is a button control the button still functions even though it
 is invisible).

again, these two seem connected (lack of mipmapping support).

 I tried executing some of the test-interactive programs and have seen
 two issues with v1.2.8.  These issues don’t exist in v1.0.10:

 1)  With the test-texture-async I get the following output in the
 console and see no output to the application window.

this has nothing to do with the rest of the issues; you have to pass a
file to the test otherwise it'll fail. I'll add a check that bails out
early instead of spewing errors.

Under v1.0.10 I didn't have to pass a file.  That was my confusion.  Now when I 
pass a file it works fine as you have stated.


 2)  With the test-texture-quality application I see the hand drawn
 properly on the first cycle, but for all other cycles, only a few
 pixels near the top are drawn.

there you go: lack of mipmapping support on your platform.

So, what has changed since v1.0.10?  This app has worked fine on various 
versions of the 1.0 branch.  It is my understanding from Intel that the driver 
I am using does have mipmapping support.

Thanks,
Kevin



---
This email and any files transmitted with it are confidential  proprietary to 
Systems and
Software Enterprises, Inc. (dba IMS). This information is intended solely for 
the use of
the individual or entity to which it is addressed. Access or transmittal of the 
information
contained in this e-mail, in full or in part, to any other organization or 
persons is not
authorized.
---


Re: [clutter] RFC: Are toggle references neede for CoglHandle ?

2010-06-08 Thread Thomas Wood
On Tue, 2010-06-08 at 13:41 +0100, Neil Roberts wrote:
 
 Recently Cogl in git has gained support for attaching arbitrary user
 data to any handle using a pointer as a key in much the same way as
 Cairo does. We could use this to attach the Ruby proxy object to the
 handle so that it could return the same object every time the handle is
 seen. However if we do this then we need to resolve the issue that both
 the proxy object and the GObject will need to reference each other yet
 we still want them to be garbage collected. Most languages that bind
 GObject seem to use toggle references to fix this. So my question is,
 should we add toggle reference support to CoglHandles?

This would certainly help someone implementing a Cogl texture cache as
well, since it is important to know when textures are no longer used.

Regards,

Thomas
 

-
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


RE: [clutter] Problem migrating from 1.0.10 to 1.2.8

2010-06-08 Thread Kevin Cote
Emmanuele:

In addition to the notes below I spent the day attempting to get my application 
running under the final Moblin 2.1 IVI release 
(moblin-2.1-PR-Final-ivi-201002090924.img).  This uses the IEGD v10.3 driver.  
To do this I upgraded my target platform with this release.

Running my application as built for clutter v1.0.10 on top of this Moblin 
release worked fine.  This release appears to be based on clutter v1.0.8.  I 
attempted to update this by the following method:
 - Installed and built v1.2.8 on my Ubuntu development environment.
 - Copied the v1.2.8 clutter library (libclutter-glx-1.0.so.0.200.8) onto the 
Moblin target system.
 - Created two links to this library (libclutter-glx-1.0.so.0, 
libclutter-glx-1.0.so)
 - Executed ldconfig on the folder that contained the above files
 - Built my application on my Ubuntu development environment.
 - Copied my application to the Moblin target system.

Now when I execute, I get the same errors that I noted in my earlier emails.

Any ideas?  If, as you say, this is a mipmapping support issue, what has 
changed within clutter to trigger this error?

Thanks,
Kevin Cote'

-Original Message-
From: Kevin Cote [mailto:kc...@imsco-us.com] 
Sent: Tuesday, June 08, 2010 9:04 AM
To: clutter@o-hand.com
Subject: RE: [clutter] Problem migrating from 1.0.10 to 1.2.8


-Original Message-
From: Emmanuele Bassi [mailto:eba...@linux.intel.com]
Sent: Tuesday, June 08, 2010 3:13 AM
To: clutter@o-hand.com
Subject: Re: [clutter] Problem migrating from 1.0.10 to 1.2.8

On Mon, 2010-06-07 at 17:04 -0700, Kevin Cote wrote:

 I have an application that I have developed over the last 6 months on
 top of v1.0.10.  I am now trying to migrate this app to v1.2.8.  I
 have tried running the migrated app under Ubuntu 9.0.4 and also
 Moblin v2.  I get the same issues in both cases.  My symptoms are twofold:

 - Text is garbled.  By this I mean that each character is
 drawn almost like a block instead of the actual glyph.

which GPU and driver are you using?

Moblin is running on a 1.6GHz Atom with a US15W (Poulsbo) GPU.  I am running 
with the IEGD driver, v10.2.


 - Certain textures are not rendered (meaning I don’t see
 them), yet the app functions as if they are there (meaning if the
 texture is a button control the button still functions even though it
 is invisible).

again, these two seem connected (lack of mipmapping support).

 I tried executing some of the test-interactive programs and have seen
 two issues with v1.2.8.  These issues don’t exist in v1.0.10:

 1)  With the test-texture-async I get the following output in the
 console and see no output to the application window.

this has nothing to do with the rest of the issues; you have to pass a
file to the test otherwise it'll fail. I'll add a check that bails out
early instead of spewing errors.

Under v1.0.10 I didn't have to pass a file.  That was my confusion.  Now when I 
pass a file it works fine as you have stated.


 2)  With the test-texture-quality application I see the hand drawn
 properly on the first cycle, but for all other cycles, only a few
 pixels near the top are drawn.

there you go: lack of mipmapping support on your platform.

So, what has changed since v1.0.10?  This app has worked fine on various 
versions of the 1.0 branch.  It is my understanding from Intel that the driver 
I am using does have mipmapping support.

Thanks,
Kevin



---
This email and any files transmitted with it are confidential  proprietary to 
Systems and
Software Enterprises, Inc. (dba IMS). This information is intended solely for 
the use of
the individual or entity to which it is addressed. Access or transmittal of the 
information
contained in this e-mail, in full or in part, to any other organization or 
persons is not
authorized.
---
�{.n�+���zwZ�%��^�맲��r��z�Z��(
N�r��zǧu���[hr[�{.n�+��r�