зеркало из https://github.com/mozilla/pjs.git
Bug 109041 -- adding call to NPP_SetWindow for windowless plugins on paint event, patch by dbrittain@superscape.com, r=av, sr=beard
This commit is contained in:
Родитель
f4008e0ec6
Коммит
293685ede3
|
@ -1739,36 +1739,34 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
|||
return rv; // done with printing
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Screen painting code
|
||||
|
||||
#if defined (XP_MAC)
|
||||
// delegate all painting to the plugin instance.
|
||||
if ((NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) && (nsnull != mInstanceOwner)) {
|
||||
mInstanceOwner->Paint(aDirtyRect);
|
||||
}
|
||||
// delegate all painting to the plugin instance.
|
||||
if ((NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) && (nsnull != mInstanceOwner))
|
||||
mInstanceOwner->Paint(aDirtyRect);
|
||||
#elif defined (XP_PC)
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
|
||||
{
|
||||
nsIPluginInstance * inst;
|
||||
if (NS_OK == GetPluginInstance(inst))
|
||||
{
|
||||
NS_RELEASE(inst);
|
||||
// Look if it's windowless
|
||||
nsPluginWindow * window;
|
||||
mInstanceOwner->GetWindow(window);
|
||||
if (window->type == nsPluginWindowType_Drawable)
|
||||
{
|
||||
PRUint32 hdc;
|
||||
aRenderingContext.RetrieveCurrentNativeGraphicData(&hdc);
|
||||
mInstanceOwner->Paint(aDirtyRect, hdc);
|
||||
}
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
|
||||
nsIPluginInstance * inst;
|
||||
if (NS_OK == GetPluginInstance(inst)) {
|
||||
// Look if it's windowless
|
||||
nsPluginWindow * window;
|
||||
mInstanceOwner->GetWindow(window);
|
||||
|
||||
if (window->type == nsPluginWindowType_Drawable) {
|
||||
PRUint32 hdc;
|
||||
aRenderingContext.RetrieveCurrentNativeGraphicData(&hdc);
|
||||
if(NS_REINTERPRET_CAST(PRUint32, window->window) != hdc) {
|
||||
window->window = NS_REINTERPRET_CAST(nsPluginPort*, hdc);
|
||||
inst->SetWindow(window);
|
||||
}
|
||||
mInstanceOwner->Paint(aDirtyRect, hdc);
|
||||
}
|
||||
NS_RELEASE(inst);
|
||||
}
|
||||
}
|
||||
#endif /* !XP_MAC */
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame", &aRenderingContext);
|
||||
return NS_OK;
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame", &aRenderingContext);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -1739,36 +1739,34 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
|||
return rv; // done with printing
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Screen painting code
|
||||
|
||||
#if defined (XP_MAC)
|
||||
// delegate all painting to the plugin instance.
|
||||
if ((NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) && (nsnull != mInstanceOwner)) {
|
||||
mInstanceOwner->Paint(aDirtyRect);
|
||||
}
|
||||
// delegate all painting to the plugin instance.
|
||||
if ((NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) && (nsnull != mInstanceOwner))
|
||||
mInstanceOwner->Paint(aDirtyRect);
|
||||
#elif defined (XP_PC)
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
|
||||
{
|
||||
nsIPluginInstance * inst;
|
||||
if (NS_OK == GetPluginInstance(inst))
|
||||
{
|
||||
NS_RELEASE(inst);
|
||||
// Look if it's windowless
|
||||
nsPluginWindow * window;
|
||||
mInstanceOwner->GetWindow(window);
|
||||
if (window->type == nsPluginWindowType_Drawable)
|
||||
{
|
||||
PRUint32 hdc;
|
||||
aRenderingContext.RetrieveCurrentNativeGraphicData(&hdc);
|
||||
mInstanceOwner->Paint(aDirtyRect, hdc);
|
||||
}
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
|
||||
nsIPluginInstance * inst;
|
||||
if (NS_OK == GetPluginInstance(inst)) {
|
||||
// Look if it's windowless
|
||||
nsPluginWindow * window;
|
||||
mInstanceOwner->GetWindow(window);
|
||||
|
||||
if (window->type == nsPluginWindowType_Drawable) {
|
||||
PRUint32 hdc;
|
||||
aRenderingContext.RetrieveCurrentNativeGraphicData(&hdc);
|
||||
if(NS_REINTERPRET_CAST(PRUint32, window->window) != hdc) {
|
||||
window->window = NS_REINTERPRET_CAST(nsPluginPort*, hdc);
|
||||
inst->SetWindow(window);
|
||||
}
|
||||
mInstanceOwner->Paint(aDirtyRect, hdc);
|
||||
}
|
||||
NS_RELEASE(inst);
|
||||
}
|
||||
}
|
||||
#endif /* !XP_MAC */
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame", &aRenderingContext);
|
||||
return NS_OK;
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame", &aRenderingContext);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче