Bug 825325 - ImageContainer::NotifyPaintedImage is not called on android. r=nical
authorPaul Adenot <paul@paul.cx>
Fri, 18 Jan 2013 16:57:17 +0100
changeset 119265 109bbd7333016bd6d4901ecc43914968c846e641
parent 119264 6ba8350ad2a601b156d7dbffb28269edc529c188
child 119266 4e7e543d21b15e8bbc41e6f93cca6e409bfb677c
push id24195
push userMs2ger@gmail.com
push dateSat, 19 Jan 2013 16:10:11 +0000
treeherdermozilla-central@02e12a80aef9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs825325
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 825325 - ImageContainer::NotifyPaintedImage is not called on android. r=nical
gfx/layers/basic/BasicImageLayer.cpp
--- a/gfx/layers/basic/BasicImageLayer.cpp
+++ b/gfx/layers/basic/BasicImageLayer.cpp
@@ -257,16 +257,18 @@ BasicShadowableImageLayer::Paint(gfxCont
   if (!mContainer) {
     return;
   }
 
   if (mContainer->IsAsync()) {
     uint32_t containerID = mContainer->GetAsyncContainerID();
     BasicManager()->PaintedImage(BasicManager()->Hold(this), 
                                  SharedImageID(containerID));
+    AutoLockImage autoLock(mContainer);
+    mContainer->NotifyPaintedImage(autoLock.GetImage());
     return;
   }
 
   nsRefPtr<gfxASurface> surface;
   AutoLockImage autoLock(mContainer, getter_AddRefs(surface));
 
   Image *image = autoLock.GetImage();
 
@@ -282,16 +284,17 @@ BasicShadowableImageLayer::Paint(gfxCont
   if (image->GetFormat() == SHARED_TEXTURE &&
       BasicManager()->GetParentBackendType() == mozilla::layers::LAYERS_OPENGL) {
     SharedTextureImage *sharedImage = static_cast<SharedTextureImage*>(image);
     const SharedTextureImage::Data *data = sharedImage->GetData();
 
     SharedTextureDescriptor texture(data->mShareType, data->mHandle, data->mSize, data->mInverted);
     SurfaceDescriptor descriptor(texture);
     BasicManager()->PaintedImage(BasicManager()->Hold(this), descriptor);
+    mContainer->NotifyPaintedImage(image);
     return;
   }
 
   if (image->GetFormat() == PLANAR_YCBCR && BasicManager()->IsCompositingCheap()) {
     PlanarYCbCrImage *YCbCrImage = static_cast<PlanarYCbCrImage*>(image);
     const PlanarYCbCrImage::Data *data = YCbCrImage->GetData();
     NS_ASSERTION(data, "Must be able to retrieve yuv data from image!");
 
@@ -340,16 +343,17 @@ BasicShadowableImageLayer::Paint(gfxCont
              data->mCbCrSize.width);
     }
 
     YUVImage yuv(mBackBufferY, mBackBufferU, mBackBufferV,
                  data->GetPictureRect());
 
     BasicManager()->PaintedImage(BasicManager()->Hold(this),
                                  yuv);
+    mContainer->NotifyPaintedImage(image);
     return;
   }
 
   gfxIntSize oldSize = mSize;
   nsRefPtr<gfxPattern> pat = GetAndPaintCurrentImage
     (aContext, GetEffectiveOpacity(), nullptr);
   if (!pat)
     return;