Bug 536199 - Crash Yahoo! frontpage with 12/21 1.9.2 nightly build [r=dougt]

This commit is contained in:
Mark Finkle 2009-12-22 16:59:34 -05:00
parent 0069f32298
commit 143fe184f9

View File

@ -5031,7 +5031,7 @@ nsPluginInstanceOwner::SetupXShm()
//
// This method supports the NPImageExpose API which is specific to the
// HILDON platform. Basically what it allows us to do is to pass a
// memory buffer into a plugin (namely flash), and have flase draw
// memory buffer into a plugin (namely flash), and have flash draw
// directly into the buffer.
//
// It may be faster if the rest of the system used offscreen image
@ -5066,10 +5066,10 @@ nsPluginInstanceOwner::NativeImageDraw(NPRect* invalidRect)
if (absPosHeight == 0 || absPosWidth == 0)
return;
if (!mSharedXImage ||
mPluginSize.width != absPosWidth ||
mPluginSize.height != absPosHeight) {
PRBool sizeChanged = (mPluginSize.width != absPosWidth ||
mPluginSize.height != absPosHeight);
if (!mSharedXImage || sizeChanged) {
mPluginSize = nsIntSize(absPosWidth, absPosHeight);
if (NS_FAILED(SetupXShm()))
@ -5083,23 +5083,24 @@ nsPluginInstanceOwner::NativeImageDraw(NPRect* invalidRect)
// setup window such that it knows about the size and clip. This
// is to work around a flash clipping bug when using the Image
// Expose API.
NPRect newClipRect;
newClipRect.left = 0;
newClipRect.top = 0;
newClipRect.right = window->width;
newClipRect.bottom = window->height;
window->clipRect = newClipRect;
window->x = 0;
window->y = 0;
if (!invalidRect && sizeChanged) {
NPRect newClipRect;
newClipRect.left = 0;
newClipRect.top = 0;
newClipRect.right = window->width;
newClipRect.bottom = window->height;
NPSetWindowCallbackStruct* ws_info =
static_cast<NPSetWindowCallbackStruct*>(window->ws_info);
ws_info->visual = 0;
ws_info->colormap = 0;
ws_info->depth = 16;
mInstance->SetWindow(window);
window->clipRect = newClipRect;
window->x = 0;
window->y = 0;
NPSetWindowCallbackStruct* ws_info =
static_cast<NPSetWindowCallbackStruct*>(window->ws_info);
ws_info->visual = 0;
ws_info->colormap = 0;
ws_info->depth = 16;
mInstance->SetWindow(window);
}
NPEvent pluginEvent;
NPImageExpose imageExpose;
@ -5781,7 +5782,7 @@ nsPluginInstanceOwner::SetAbsoluteScreenPosition(nsIDOMElement* element,
clip->GetWidth(&width);
clip->GetHeight(&height);
mAbsolutePositionClip = gfxRect(left,top, width, height);
mAbsolutePositionClip = gfxRect(left, top, width, height);
mBlitParentElement = element;