Problem with dropdown menu in off-screen rendering mode

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Problem with dropdown menu in off-screen rendering mode

Postby Czarek » Sun Dec 30, 2012 11:27 am

Hi,

I'm using off-screen rendering along with Panda3D game engine:
http://code.google.com/p/cefpython/wiki/Panda3D

Everything works fine, there is only a problem when I click dropdown menu on a webpage, I get an assertion error in Panda3D:

Code: Select all
Traceback (most recent call last):

  File "c:\Panda3D-1.8.0\direct\showbase\ShowBase.py", line 1844, in __igLoop
    self.graphicsEngine.renderFrame()

AssertionError: image_ptr >= orig_image_ptr && image_ptr + view_size <= orig_image_ptr + tex->get_ram_mipmap_image_size(
n) at line 8893 of c:\buildslave\release_sdk_win32\build\panda3d\panda\src\glstuff\glGraphicsStateGuardian_src.cxx


There seems to be something wrong with the void* buffer provided in OnPaint() when dropdown menu appears.

In CefRenderHandler I've implemented only OnPaint() event, do I need to implement also GetViewRect(), GetScreenRect() & GetScreenPoint()? I've tried making the browser view on whole screen and provided coordinates to these functions, but still I get the same assertion error.

I'm not sure what is going on, what is different in OnPaint() event when drop down menu appears?

Czarek.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Problem with dropdown menu in off-screen rendering mode

Postby Czarek » Wed Jan 02, 2013 6:26 pm

I see now what is going, when you click on dropdown menu, the paintElementType is PET_POPUP (normally PET_VIEW) and the buffer contains data for drawing only the popup widget (dropdown menu).

So what is the way to get the buffer with the whole browser view along with dropdown menu being drawn? Am I supposed to call CefBrowser->GetImage() when paintElementType == PET_POPUP and draw the popup widget myself by modifying the buffer? How do I detect the coordinates of where to draw it? The rect passed to OnPaint for PET_POPUP is x=0, y=0. Isn't there an easeri way? Can't chromium draw it for me and just provide the buffer?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Problem with dropdown menu in off-screen rendering mode

Postby magreenblatt » Thu Jan 03, 2013 2:58 pm

Take a look at the cefclient sample. IIRC it handles this by keeping two separate textures (one for the view and one for the popup), and then rendering them both while the popup is visible.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 217 guests