diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index e7d60a44c0cd..d0fbdc76ee8e 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -3434,30 +3434,6 @@ void nsPluginInstanceOwner::SetFrame(nsObjectFrame *aFrame) // If we already have a frame that is changing or going away... if (mObjectFrame) { - // We have an old frame. - // Drop image reference because the child may destroy the surface after we return. - nsRefPtr container = mObjectFrame->GetImageContainer(); - if (container) { -#ifdef XP_MACOSX - AutoLockImage autoLock(container); - Image *image = autoLock.GetImage(); - if (image && (image->GetFormat() == MAC_IO_SURFACE) && mObjectFrame) { - // Undo what we did to the current image in SetCurrentImageInTransaction(). - MacIOSurfaceImage *oglImage = static_cast(image); - oglImage->SetUpdateCallback(nullptr, nullptr); - oglImage->SetDestroyCallback(nullptr); - // If we have a current image here, its destructor hasn't yet been - // called, so OnDestroyImage() can't yet have been called. So we need - // to do ourselves what OnDestroyImage() would have done. - NS_RELEASE_THIS(); - } - // Important! Unlock here otherwise SetCurrentImageInTransaction will deadlock with - // our lock if we have a RemoteImage. - autoLock.Unlock(); -#endif - container->SetCurrentImageInTransaction(nullptr); - } - // Make sure the old frame isn't holding a reference to us. mObjectFrame->SetInstanceOwner(nullptr); } diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 5f8d41cb8be2..09b9cb424271 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1241,11 +1241,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, #endif } - nsRefPtr container = GetImageContainer(); - if (container && (container->HasCurrentImage() || !isVisible || - container->GetCurrentSize() != gfxIntSize(window->width, window->height))) { - mInstanceOwner->NotifyPaintWaiter(aBuilder); - } + mInstanceOwner->NotifyPaintWaiter(aBuilder); } // determine if we are printing @@ -1524,20 +1520,6 @@ nsObjectFrame::PrintPlugin(nsRenderingContext& aRenderingContext, nullptr, status); // DidReflow will take care of it } -already_AddRefed -nsObjectFrame::GetImageContainer() -{ - nsRefPtr container = mImageContainer; - - if (container) { - return container.forget(); - } - - container = mImageContainer = LayerManager::CreateImageContainer(); - - return container.forget(); -} - nsRect nsObjectFrame::GetPaintedRect(nsDisplayPlugin* aItem) { diff --git a/layout/generic/nsObjectFrame.h b/layout/generic/nsObjectFrame.h index 478ff54ec4d4..136b68363c1c 100644 --- a/layout/generic/nsObjectFrame.h +++ b/layout/generic/nsObjectFrame.h @@ -173,7 +173,6 @@ public: LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager); - already_AddRefed GetImageContainer(); /** * Get the rectangle (relative to this frame) which it will paint. Normally * the frame's content-box but may be smaller if the plugin is rendering @@ -290,10 +289,6 @@ private: bool mReflowCallbackPosted; - // A reference to the ImageContainer which contains the current frame - // of plugin to display. - nsRefPtr mImageContainer; - // We keep this reference to ensure we can always unregister the // plugins we register on the root PresContext. // This is only non-null while we have a plugin registered for geometry