Bug 1276020 - InvalidateRect in PluginInstanceParent::SetCurrentImage() r=dvander
authorSotaro Ikeda <sotaro.ikeda.g@gmail.com>
Mon, 06 Jun 2016 18:14:44 -0700
changeset 376163 189923b75373b22b5edcc30ef97e1b8d87f587ec
parent 376162 d6aea1ba992f47371228e66b7774761cb5326bae
child 376164 c605b6253cdb354a69de5d31e8146b3dbdcf93bb
push id20510
push usercholler@mozilla.com
push dateTue, 07 Jun 2016 13:42:30 +0000
reviewersdvander
bugs1276020
milestone50.0a1
Bug 1276020 - InvalidateRect in PluginInstanceParent::SetCurrentImage() r=dvander
dom/plugins/ipc/PluginInstanceParent.cpp
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -823,16 +823,21 @@ PluginInstanceParent::SetCurrentImage(Im
     MOZ_ASSERT(IsUsingDirectDrawing());
     ImageContainer::NonOwningImage holder(aImage);
     holder.mFrameID = ++mFrameID;
 
     AutoTArray<ImageContainer::NonOwningImage,1> imageList;
     imageList.AppendElement(holder);
     mImageContainer->SetCurrentImages(imageList);
 
+    // Invalidate our area in the page so the image gets flushed.
+    gfx::IntRect rect = aImage->GetPictureRect();
+    NPRect nprect = {uint16_t(rect.x), uint16_t(rect.y), uint16_t(rect.width), uint16_t(rect.height)};
+    RecvNPN_InvalidateRect(nprect);
+
     RecordDrawingModel();
 }
 
 bool
 PluginInstanceParent::RecvShowDirectDXGISurface(const WindowsHandle& handle,
                                                  const gfx::IntRect& dirty)
 {
 #if defined(XP_WIN)