Implement Delegate renderer using frame buffer object on Tizen.
authorvenu.musham <venu.musham@samsung.com>
Fri, 24 Apr 2015 14:08:28 +0000 (19:38 +0530)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
commitedc7eb2c7d685a00b68167a5fd20dbff45d64a47
treed0c4ac44b2cddf1e954c9d506f79f529e15d3f4a
parent690d7d3fd4e4632a497cfbd6f5065f5126117162
Implement Delegate renderer using frame buffer object on Tizen.

In Tizen, only web contents parts of the browser window in an OpenGL surface
drawn by chromium. The rest of the window is drawn using evas reference
browser/mini browser. This is because we don't have a way to draw on native
surface. evas direct rendering does not support calling native surface swap
from different thread.

To solve this problem, we composite to intermediate texture and use this
texture for rendering on evas native surface.

1. When renderer has new frame that it wants drawn, it sends a
   ViewHostMsg_SwapCompositorFrame to browser process.

2. Browser process takes frame from renderer and passes to RWHV.

3. Frame is passed to DelegatedFrameHost (DFH), which acts as interface
   between ui::Compositor and the renderer.

4. DFH tells the ui::Compositor to draw a new frame with updated
   contents.

5. ui::Compositor requests for commit operation(to draw frame).

6. On receiving commit, ui::Compositor renders frame onto frame buffer
   object created by MailboxOutputSurfaceEfl::EnsureBackBuffer().

7. When done drawing the frame, ui::Compositor's
   cc::LayerTreeHostImpl's cc:OutPutSurface will issue glSwapBuffers
   to GPU process.
   cc::Compositor will be blocked until cc::OutPutSurface client calls
   its OnSwapBuffersComplete().

8. The command buffer will decode and call
   MailboxOutputSurfaceEfl::SwapBuffers(), this will send texture_id
   from FBO to RWHV and calls evas_object_image_pixels_dirty_set() to
   invalidate evas surface and draw updated texture by calling
   glBindTexture(texture_id).

9. After this, cc::Compositor is unblocked, allowing the
   ui::Compositor to produce more frames. DFH::SendDelegatedFrameAck
   is called, which sends ViewHostMsg_SwapCompositorAck to the renderer
   process to produce another frame.
Reviewed by: DaeHyun Ko, KwangHyuk Kim, Prashant Nevase

Change-Id: I539f8aa0333a5a0dde6c921085af11ca7d9c1dc4
Signed-off-by: venu.musham <venu.musham@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/context_factory_efl.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/renderer_host/context_factory_efl.h [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h
tizen_src/chromium_impl/content/content_efl.gypi
tizen_src/chromium_impl/efl/init.cc