[webkit-help] Finding "visible" region of element, or preventing overlap in layout

Konstantin Tokarev annulen at yandex.ru
Mon Feb 20 09:21:36 PST 2012



20.02.2012, 20:52, "Simon Fraser" <simon.fraser at apple.com>:
> On Feb 18, 2012, at 10:34 AM, Konstantin Tokarev wrote:
>
>>  16.02.2012, 18:21, "Konstantin Tokarev" <annulen at yandex.ru>:
>>>  Hi all,
>>>
>>>  I'm developing custom media engine (i.e. MediaPlayerPrivate subclass etc.) for embedded platform, and due to platform's limitations I have to render video on top of all page layers. This leads to broken rendering of elements which overlap video region.
>>>
>>>  I can imagine two ways to solve this problem:
>>>  1) Get "visible" region of <video> element, i.e. region which is not overlapped by other elements, and crop video frame to it.
>>>  2) Give some hint to layout manager to prevent all elements from overlapping <video>
>>>
>>>  Could anyone give me some hints on it?
>>  Bump.
>>
>>  There is absolutely no possibility of using accelerated compositing for video element rendering because video has to be run in different hardware layer. "Dirty hacks" like inserting fake elements would be OK.
>
> The whole point of accelerated compositing mode is to put elements in the page into their own hardware layers, and video is one of the things already handled this way.
>
> What the accelerated compositing code does not do is to deal with limited numbers of hardware layers (e.g. if you just have 2 or 3 hardware planes). But I think you could deal with that under the GraphicsLayer code.

My platform is IPTV set-top box. It has 2 separate layers: graphics layer and video layer. All contents of browser can only be rendered in graphics layer, and HTML5 video should be rendered in video layer, which performs much better for this purpose. Rendering of video in graphics layer ruins performance, and there is no possibility to put video layer between layers of browser graphics. To make things worse, video is processed by different process running on different CPU with different architecture, and I can only communicate with it via vendor-provided API.

The best thing we was able to device was cutting a window in a graphics layer, so from outside it looks like video stream "overlays" all graphic elements disregarding their Z-order. That would work quite nice if web developers didn't put their controls on top of video element, but they do :(

So, I guess that the only thing I can do is to hack a renderer in a very dirty way.

-- 
Regards,
Konstantin


More information about the webkit-help mailing list