[webkit-help] Capture rendering buffer (windows)

Chris Hatko chatko at gmail.com
Tue Jul 13 07:36:44 PDT 2010


Thanks Alex,

I tried using paintDocumentRectToContext, but I was asking for the
paint 30/sec and found that providing a rectangle for the entire
window was too slow. I've made some progress with my original method
which only invalidates the flash/plugin areas  and uses the
backingstore bitmap as the 30/sec snapshot. Below is some code I found
to search for plugin areas. I Hope it helps someone ...

     // get the plugin (flash) areas and invalidate them
     IntRect pluginArea;

     for (Frame* frame = (this->m_page)->mainFrame(); frame; frame =
frame->tree()->traverseNext())
	 {
		FrameView* view = frame->view();
                if (!view)
                   return 0;

               const HashSet<RefPtr<Widget> >* children = view->children();
               ASSERT(children);

               HashSet<RefPtr<Widget> >::const_iterator end = children->end();
               for (HashSet<RefPtr<Widget> >::const_iterator it =
children->begin(); it != end; ++it)
               {
                   Widget* widget = (*it).get();
                   if (widget->isPluginView())  // works for flash at least
		   {
				pluginArea = (static_cast<PluginView*>(widget))->windowClipRect();
				this->addToDirtyRegion(pluginArea);
		   }
              }
     }


One item i have noticed and that I've wasted many hours debugging is
that the latest Flash (10.1) doesn't render at full speed when it is
in a hidden window. I'll send another question to the group detailing
this.

Thanks,

Chris


On Mon, Jul 12, 2010 at 8:34 AM, Alexander Shulgin
<alexander.shulgin at yessoftware.com> wrote:
> On 09.07.2010 22:18, Chris Hatko wrote:
>>
>> Hi,
>>
>> My goal is to get the cario webkit port to render to a buffer instead
>> of a window (i'll be making the window invisible), with as little
>> change to the port source as possible.
>
> I'm using IWebFramePrivate::paintDocumentRectToContext(RECT, HDC) for this.
>  It works with pretty reasonable results and w/o the need to modify the
> source code.
>
> --
> Alex
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>


More information about the webkit-help mailing list