On Wed, 5 Jan 2011 09:41:51 +0100 Michael Taubert <mich...@arachnodroid.de>
said:

> 
> Am 05.01.2011 um 08:31 schrieb Carsten Haitzler (The Rasterman):
> 
> > On Sat, 1 Jan 2011 14:16:47 +0100 Michael Taubert <mich...@arachnodroid.de>
> > said:
> > 
> >> Hi all!
> >> 
> >> I'm trying to draw an evas text object within an ecore_evas_gl_x11_new().
> >> 
> >> As stated in the Evas/Ecore docs, there should be no need to update it
> >> manually, except for updating the content within an animator. My assumption
> >> was this:
> >> 
> >> - Init of ecore, evas, ecore_evas, ecore_x
> >> - Create an gl_x11 Evas_Object
> >> - Add a text object
> >> - configure the text object (color,text,...)
> >> - Show the object
> >> - Show the gl_x11 Canvas/Window (depends on wether a parent window has been
> >> supplied)
> >> - Register an animator for content updates
> >> - Start the ecore mainloop
> >> 
> >> But it is not working. I saw that some people are using the elementary
> >> mainloop, but I don't need any widgets here. What should be the correct way
> >> to setup a canvas or window and have it updated within ecore's mainloop?
> > 
> > you have it right. maybe try a rectangle as a bg (a big white or blue or
> > grey rect) and then move a different colored rect obj around instead of text
> > your text obj may not appear due to font not being available that u set up?
> > u'll know if font works by getting text obj geometry after setting up font
> > +text -it will be 0x0.
> > 
> > i assume the window appears - it's just empty?
> 
> Yes, it was just empty. Well, filled with memory noise. I've added a
> background rectangle, set layers, and it is working now.
> 
> But I've problems using transparency. I can set the window shaped, but no
> alpha and transparency. I've tried it with the gl_x11 and software_x11
> engine, but both fail to draw a half-transparent background. I even tried
> a .png with a gradient from red to transparent, but no luck.

shaped windows doesnt work with gl - to do a shaped window would require
reading back the gl bcuffer from hw, scanning it with the cpu to generate
rectangles then uses these as the shape. as such this totally kills any benefit
of ever having used GL. use software. it's faster. destination alpha works in
gl with EGL - it doesnt work with normal gl as for some odd reason no matter
what - gl refuses to use an ARGB dest buffer when i create it. it fails and
ceases to work. there is code. it will try - then crash. glXMakeCurrent() fails
and i dont know why. but as such it's supported (dest alpha). as such you have
a choice - if you want dest alpha ANd shaped to work - use software x11. if you
want just dest alpha (only useful if you use a compositor) then use EGL on an
opengl-es system (embedded). desktop doesn't work. beats me why. i have spent a
lot of time kicking that code to try make it work - no luck. elementary has a
test for this "icon transparent" - normally elm uses software-x11. u canuse gl
with:
ELM_ENGINE=gl elementary_test

then try it - u'll see the issue.

> Using gl_x11 fails at all and logs messages about a missing or wrong input
> handler/method/whatsoever. As soon as I set alpha or transparency.
> 
> But a glxinfo says that direct rendering is enabled. Did I miss something
> setting up OpenGL?
> 
> Is there any X module that needs to be setup to get transparency?

for alpha channel u need a compositor running. otherwise shaped stuff can work
- but as above. not with gl. wont ever work as its pointless to make it work.
it will just be as slow or even much slower than software. for dest alpha.. see
above.

> Another thing is that, if I use gl_x11 without transparency at all, the
> actual cpu load is at ~40%. software_x11 will use just ~8%. I thought that it
> should be the opposite. This happens on two different computers. Just to
> mention that.

entirely depends on gpu an drivers and whats in your canvas "scene" and what
changes. as such time spent in the driver "waiting" on the gpu to finish will
count as cpu time for the app - even tho cpu isnt necessarily being used. it
may block and wait calling yield() often and poll or actively poll without
yielding. if it had a real interrupt driven block waiting on gpu to finish it
wouldnt (or shouldnt) register cpu usage.

the other thing is that the gl engine re-draws the whole canvas every update.
the software engine only re-rendering the changed regions. this is entirely due
to the way opengl works and to get the  best performance out of it you really
have no choice but to re-draw everything and swap buffers (swapping
necessitates re-draw of everything). otherwise u'd add an extra draw stage
(draw to fbo - and u'd STILL need to copy the fbo to the backbuffer in-full)
and and copy in the pipeline and that would harm performance. so if all u have
is a tiny text or rect blob moving - yes, software will win. it will do
absolutely minimal redraws. gl will re-draw it all. wait until you have a whole
canvas scrolling or changing with 1000's of objects and see if you still thing
gl is a problem :)

> > 
> >> Thanks in advance,
> >> Michael
> >> 
> >> 
> >> ------------------------------------------------------------------------------
> >> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> >> to consolidate database storage, standardize their database environment,
> >> and, should the need arise, upgrade to a full multi-node Oracle RAC
> >> database without downtime or disruption
> >> http://p.sf.net/sfu/oracle-sfdevnl
> >> _______________________________________________
> >> enlightenment-devel mailing list
> >> enlightenment-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >> 
> > 
> > 
> > -- 
> > ------------- Codito, ergo sum - "I code, therefore I am" --------------
> > The Rasterman (Carsten Haitzler)    ras...@rasterman.com
> > 
> 
> 
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and, 
> should the need arise, upgrade to a full multi-node Oracle RAC database 
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to