Bug 556889 - Backed out changeset 6f250c9b680b due to reftest failure on Linux.
authorChris Pearce <chris@pearce.org.nz>
Thu, 08 Apr 2010 21:18:58 +1200
changeset 40585 af2fa9a53db51e9e4ecc89ceb4333537b24562ef
parent 40581 6f250c9b680ba60704cfbd5e939b2e9c8e20c05c
child 40586 26dd5773a08ae5366e1482d271eed0ff49404bf8
push idunknown
push userunknown
push dateunknown
bugs556889
milestone1.9.3a5pre
Bug 556889 - Backed out changeset 6f250c9b680b due to reftest failure on Linux.
gfx/layers/ImageLayers.h
gfx/layers/basic/BasicImages.cpp
gfx/layers/opengl/ImageLayerOGL.cpp
gfx/layers/opengl/ImageLayerOGL.h
layout/generic/nsVideoFrame.cpp
layout/reftests/ogg-video/black100x100-aspect3to2.ogv
layout/reftests/ogg-video/encoded-aspect-ratio-1.html
layout/reftests/ogg-video/ref-black150x100.html
layout/reftests/ogg-video/reftest.list
--- a/gfx/layers/ImageLayers.h
+++ b/gfx/layers/ImageLayers.h
@@ -162,21 +162,16 @@ public:
    * accessed on the main thread.
    */
   LayerManager* Manager()
   {
     NS_PRECONDITION(NS_IsMainThread(), "Must be called on main thread");
     return mManager;
   }
 
-  /**
-   * Returns the size of the image in pixels.
-   */
-  virtual gfxIntSize GetCurrentSize() = 0;
-
 protected:
   LayerManager* mManager;
 
   ImageContainer(LayerManager* aManager) : mManager(aManager) {}
 };
 
 /**
  * A Layer which renders an Image.
--- a/gfx/layers/basic/BasicImages.cpp
+++ b/gfx/layers/basic/BasicImages.cpp
@@ -193,17 +193,16 @@ public:
   BasicImageContainer(BasicLayerManager* aManager) :
     ImageContainer(aManager), mMonitor("BasicImageContainer")
   {}
   virtual already_AddRefed<Image> CreateImage(const Image::Format* aFormats,
                                               PRUint32 aNumFormats);
   virtual void SetCurrentImage(Image* aImage);
   virtual already_AddRefed<Image> GetCurrentImage();
   virtual already_AddRefed<gfxASurface> GetCurrentAsSurface(gfxIntSize* aSize);
-  virtual gfxIntSize GetCurrentSize();
 
 protected:
   Monitor mMonitor;
   nsRefPtr<Image> mImage;
 };
 
 /**
  * Returns true if aFormat is in the given format array.
@@ -263,23 +262,16 @@ BasicImageContainer::GetCurrentAsSurface
   MonitorAutoEnter mon(mMonitor);
   if (!mImage) {
     return nsnull;
   }
   *aSizeResult = ToImageData(mImage)->GetSize();
   return ToImageData(mImage)->GetAsSurface();
 }
 
-gfxIntSize
-BasicImageContainer::GetCurrentSize()
-{
-  MonitorAutoEnter mon(mMonitor);
-  return !mImage ? gfxIntSize(0,0) : ToImageData(mImage)->GetSize();
-}
-
 already_AddRefed<ImageContainer>
 BasicLayerManager::CreateImageContainer()
 {
   nsRefPtr<ImageContainer> container = new BasicImageContainer(this);
   return container.forget();
 }
 
 }
--- a/gfx/layers/opengl/ImageLayerOGL.cpp
+++ b/gfx/layers/opengl/ImageLayerOGL.cpp
@@ -84,38 +84,16 @@ ImageContainerOGL::GetCurrentImage()
 }
 
 already_AddRefed<gfxASurface>
 ImageContainerOGL::GetCurrentAsSurface(gfxIntSize *aSize)
 {
   return nsnull;
 }
 
-gfxIntSize
-ImageContainerOGL::GetCurrentSize()
-{
-  MutexAutoLock lock(mActiveImageLock);
-  if (!mActiveImage) {
-    return gfxIntSize(0,0);
-  }
-  if (mActiveImage->GetFormat() == Image::PLANAR_YCBCR) {
-    PlanarYCbCrImageOGL *yuvImage =
-      static_cast<PlanarYCbCrImageOGL*>(mActiveImage.get());
-    if (!yuvImage->HasData()) {
-      return gfxIntSize(0,0);
-    }
-    return yuvImage->mSize;
-  } else if (mActiveImage->GetFormat() == Image::CAIRO_SURFACE) {
-    CairoImageOGL *cairoImage =
-      static_cast<CairoImageOGL*>(mActiveImage.get());
-    return cairoImage->mSize;
-  }
-  return gfxIntSize(0,0);
-}
-
 LayerOGL::LayerType
 ImageLayerOGL::GetType()
 {
   return TYPE_IMAGE;
 }
 
 Layer*
 ImageLayerOGL::GetLayer()
--- a/gfx/layers/opengl/ImageLayerOGL.h
+++ b/gfx/layers/opengl/ImageLayerOGL.h
@@ -54,19 +54,16 @@ public:
   virtual already_AddRefed<Image> CreateImage(const Image::Format* aFormats,
                                               PRUint32 aNumFormats);
 
   virtual void SetCurrentImage(Image* aImage);
 
   virtual already_AddRefed<Image> GetCurrentImage();
 
   virtual already_AddRefed<gfxASurface> GetCurrentAsSurface(gfxIntSize* aSize);
-
-  virtual gfxIntSize GetCurrentSize();
-
 private:
   typedef mozilla::Mutex Mutex;
 
   nsRefPtr<Image> mActiveImage;
 
   Mutex mActiveImageLock;
 };
 
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -217,24 +217,16 @@ nsVideoFrame::BuildLayer(nsDisplayListBu
       return nsnull;
 
     NS_ASSERTION(image->GetFormat() == cairoFormat, "Wrong format");
     static_cast<CairoImage*>(image.get())->SetData(cairoData);
     tmpContainer->SetCurrentImage(image);
     container = tmpContainer.forget();
   }
 
-  // Retrieve the size of the decoded video frame, before being scaled
-  // by pixel aspect ratio.
-  gfxIntSize frameSize = container->GetCurrentSize();
-  if (frameSize.width == 0 || frameSize.height == 0) {
-    // No image, or zero-sized image. No point creating a layer.
-    return nsnull;
-  }
-
   // Compute the rectangle in which to paint the video. We need to use
   // the largest rectangle that fills our content-box and has the
   // correct aspect ratio.
   nsPresContext* presContext = PresContext();
   gfxRect r = gfxRect(presContext->AppUnitsToGfxUnits(area.x),
                       presContext->AppUnitsToGfxUnits(area.y),
                       presContext->AppUnitsToGfxUnits(area.width),
                       presContext->AppUnitsToGfxUnits(area.height));
@@ -244,17 +236,17 @@ nsVideoFrame::BuildLayer(nsDisplayListBu
   if (!layer)
     return nsnull;
 
   layer->SetContainer(container);
   layer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(this));
   // Set a transform on the layer to draw the video in the right place
   gfxMatrix transform;
   transform.Translate(r.pos);
-  transform.Scale(r.Width()/frameSize.width, r.Height()/frameSize.height);
+  transform.Scale(r.Width()/videoSize.width, r.Height()/videoSize.height);
   layer->SetTransform(gfx3DMatrix::From2D(transform));
   nsRefPtr<Layer> result = layer.forget();
   return result.forget();
 }
 
 NS_IMETHODIMP
 nsVideoFrame::Reflow(nsPresContext*           aPresContext,
                      nsHTMLReflowMetrics&     aMetrics,
deleted file mode 100644
index 81fe51ffb3e7bf899377eb3c500c257c5d72a3a0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/layout/reftests/ogg-video/encoded-aspect-ratio-1.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body style="background:white;">
-<!-- Test if video displays correctly with a 3:2 aspect ratio.
-     It should display at w=150 h=100. -->
-<video src="black100x100-aspect3to2.ogv"></video>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/ogg-video/ref-black150x100.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body style="background:white;">
-<div style="background-color: black; width: 150px; height: 100px"></div>
-</body>
-</html>
--- a/layout/reftests/ogg-video/reftest.list
+++ b/layout/reftests/ogg-video/reftest.list
@@ -1,15 +1,14 @@
 HTTP(..) == aspect-ratio-1a.xhtml aspect-ratio-1-ref.html
 HTTP(..) == aspect-ratio-1b.xhtml aspect-ratio-1-ref.html
 skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == aspect-ratio-2a.xhtml aspect-ratio-2-ref.html
 skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == aspect-ratio-2b.xhtml aspect-ratio-2-ref.html
 HTTP(..) == aspect-ratio-3a.xhtml aspect-ratio-3-ref.xhtml
 HTTP(..) == aspect-ratio-3b.xhtml aspect-ratio-3-ref.xhtml
-== encoded-aspect-ratio-1.html ref-black150x100.html
 HTTP(..) == basic-1.xhtml basic-1-ref.html
 HTTP(..) == canvas-1a.xhtml basic-1-ref.html
 HTTP(..) == canvas-1b.xhtml basic-1-ref.html
 == clipping-1a.html clipping-1-ref.html
 == empty-1a.html empty-1-ref.html
 == empty-1b.html empty-1-ref.html
 random HTTP(..) == object-aspect-ratio-1a.xhtml aspect-ratio-1-ref.html
 random HTTP(..) == object-aspect-ratio-1b.xhtml aspect-ratio-1-ref.html