Hi, Boris

I have a question about rendering plugin as well.
I implemented a windowless plugin which can use the HDC passed from 
nsObjectFrame to draw something (like rect, line) in the plugin.
In order to draw a bitmap in the plugin, I'd like to call 
nsIRenderingContext's method (my image is in imgIContainer).
But when I use the nsIRenderingContext ptr obtained from
  nsIViewManager* vm = mView->GetViewManager();
  vm->GetWidgetForView(mView, getter_AddRefs(widget));
  mRenderingCtx = widget->GetRenderingContext();

and call DrawImage or DrawScaledImage, the image does not appear in the 
plugin.
When I resize the browser window, I can see the image is flashing.

I did the other test:
1. use the DC got from widget->GetNativeData(NS_NATIVE_GRAPHIC) to draw a 
rect.
2. use the DC passed in from nsObjectFrame to draw a rect.

The 1st rect is not shown either, when resize the browser, I can see it is 
flashing.
The 2nd rect can be shown correctly and steadily.

Since there is ONLY one widget in the browser, I don't know why two DCs from 
it will make such a difference.
Can you nice guys give me some guide? And how to solve this problem?

And is there any document about the principle of double-buffered rendering?

Thank you very much.

"Boris Zbarsky" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Sam Deane wrote:
>> I'm not clear from the discussions that I've read whether the Gecko
>> rendering is double-buffered, or whether it just splashes things
>> straight into a window.
>
> It's usually double-buffered, at least for painting of the non-plugin 
> content. The one exception, I believe, is on Mac on pages where plugins 
> are present. Mac plugins apparently throw a fit when you try to 
> double-buffer those pages...
>
>> In particular, I'm wondering what happens with
>> plug-ins - do they get rendered 'directly' into the window for
>> efficiency and/or compliance with the underlying APIs that they call
>> (again, Quicktime, Flash etc)?
>
> This may depend on whether the plugin is in windowless mode or not... :(
>
>> I've seen references to buffering / offscreen rendering in the
>> archives along the lines of "it doesn't do it yet", but they are all
>> fairly old so I'm crossing my fingers and hoping that they might now
>> be out of date.
>
> No, those are up to date.  There's code floating about to do it, but it's 
> not in the tree yet....
>
> -Boris 


_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to