Bug 929513 Part 11: Convert ImageLayer's mScaleToSize to use LayerIntSize r=nical
☠☠ backed out by a2eecdb6d6b0 ☠ ☠
authorDavid Zbarsky <dzbarsky@gmail.com>
Sun, 27 Oct 2013 17:53:29 -0400
changeset 166244 f872d288480b9079697d4c52bc26d1116e5c3131
parent 166243 35a4cfc4196510bea935dd515d0845cb6cf7efcc
child 166245 a2eecdb6d6b0ced94b3ffe8a47d831173e390d90
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs929513
milestone27.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 929513 Part 11: Convert ImageLayer's mScaleToSize to use LayerIntSize r=nical
gfx/layers/ImageLayers.h
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/client/ClientImageLayer.cpp
gfx/layers/ipc/LayersMessages.ipdlh
layout/generic/nsObjectFrame.cpp
xpcom/base/nsMemoryReporterManager.cpp
--- a/gfx/layers/ImageLayers.h
+++ b/gfx/layers/ImageLayers.h
@@ -45,29 +45,30 @@ public:
       Mutated();
     }
   }
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the size to scale the image to and the mode at which to scale.
    */
-  void SetScaleToSize(const gfxIntSize &aSize, ScaleMode aMode)
+  void SetScaleToSize(const gfx::IntSize &aSize, ScaleMode aMode)
   {
-    if (mScaleToSize != aSize || mScaleMode != aMode) {
-      mScaleToSize = aSize;
+    LayerIntSize size(aSize.width, aSize.height);
+    if (mScaleToSize != size || mScaleMode != aMode) {
+      mScaleToSize = size;
       mScaleMode = aMode;
       Mutated();
     }
   }
 
 
   ImageContainer* GetContainer() { return mContainer; }
   GraphicsFilter GetFilter() { return mFilter; }
-  const gfxIntSize& GetScaleToSize() { return mScaleToSize; }
+  const LayerIntSize& GetScaleToSize() { return mScaleToSize; }
   ScaleMode GetScaleMode() { return mScaleMode; }
 
   MOZ_LAYER_DECL_NAME("ImageLayer", TYPE_IMAGE)
 
   virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface);
 
   /**
    * if true, the image will only be backed by a single tile texture
@@ -84,17 +85,17 @@ public:
 protected:
   ImageLayer(LayerManager* aManager, void* aImplData);
   ~ImageLayer();
   virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
 
 
   nsRefPtr<ImageContainer> mContainer;
   GraphicsFilter mFilter;
-  gfxIntSize mScaleToSize;
+  LayerIntSize mScaleToSize;
   ScaleMode mScaleMode;
   bool mDisallowBigImage;
 };
 
 }
 }
 
 #endif /* GFX_IMAGELAYER_H */
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -346,17 +346,17 @@ struct ImageLayerProperties : public Lay
     }
 
     return nsIntRect();
   }
 
   nsIntRegion mVisibleRegion;
   nsRefPtr<ImageContainer> mContainer;
   GraphicsFilter mFilter;
-  gfxIntSize mScaleToSize;
+  LayerIntSize mScaleToSize;
   ScaleMode mScaleMode;
 };
 
 LayerPropertiesBase*
 CloneLayerTreePropertiesInternal(Layer* aRoot)
 {
   if (!aRoot) {
     return new LayerPropertiesBase();
--- a/gfx/layers/client/ClientImageLayer.cpp
+++ b/gfx/layers/client/ClientImageLayer.cpp
@@ -58,17 +58,17 @@ public:
   
   virtual void ClearCachedResources() MOZ_OVERRIDE
   {
     DestroyBackBuffer();
   }
 
   virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
   {
-    aAttrs = ImageLayerAttributes(mFilter, mScaleToSize, mScaleMode);
+    aAttrs = ImageLayerAttributes(mFilter, mScaleToSize.ToUnknownSize(), mScaleMode);
   }
 
   virtual Layer* AsLayer() { return this; }
   virtual ShadowableLayer* AsShadowableLayer() { return this; }
 
   virtual void Disconnect()
   {
     DestroyBackBuffer();
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -31,16 +31,17 @@ using mozilla::ScreenRotation;
 using nsCSSProperty;
 using mozilla::dom::ScreenOrientation;
 using mozilla::layers::TextureInfo;
 using mozilla::LayerMargin;
 using mozilla::LayerPoint;
 using mozilla::LayerRect;
 using mozilla::layers::ScaleMode;
 using mozilla::layers::DiagnosticTypes;
+using mozilla::gfx::IntSize;
 
 namespace mozilla {
 namespace layers {
 
 struct TargetConfig {
   nsIntRect naturalBounds;
   ScreenRotation rotation;
   nsIntRect clientBounds;
@@ -210,17 +211,17 @@ struct ContainerLayerAttributes {
   float preXScale;
   float preYScale;
   float inheritedXScale;
   float inheritedYScale;
 };
 struct ColorLayerAttributes     { LayerColor color; nsIntRect bounds; };
 struct CanvasLayerAttributes    { GraphicsFilterType filter; nsIntRect bounds; };
 struct RefLayerAttributes       { int64_t id; };
-struct ImageLayerAttributes     { GraphicsFilterType filter; gfxIntSize scaleToSize; ScaleMode scaleMode; };
+struct ImageLayerAttributes     { GraphicsFilterType filter; IntSize scaleToSize; ScaleMode scaleMode; };
 
 union SpecificLayerAttributes {
   null_t;
   ThebesLayerAttributes;
   ContainerLayerAttributes;
   ColorLayerAttributes;
   CanvasLayerAttributes;
   RefLayerAttributes;
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1522,17 +1522,17 @@ nsObjectFrame::BuildLayer(nsDisplayListB
     return nullptr;
 
   // window is in "display pixels", but size needs to be in device pixels
   double scaleFactor = 1.0;
   if (NS_FAILED(mInstanceOwner->GetContentsScaleFactor(&scaleFactor))) {
     scaleFactor = 1.0;
   }
   int intScaleFactor = ceil(scaleFactor);
-  gfxIntSize size(window->width * intScaleFactor, window->height * intScaleFactor);
+  gfx::IntSize size(window->width * intScaleFactor, window->height * intScaleFactor);
 
   nsRect area = GetContentRectRelativeToSelf() + aItem->ToReferenceFrame();
   gfxRect r = nsLayoutUtils::RectToGfxRect(area, PresContext()->AppUnitsPerDevPixel());
   // to provide crisper and faster drawing.
   r.Round();
   nsRefPtr<Layer> layer =
     (aManager->GetLayerBuilder()->GetLeafLayerFor(aBuilder, aItem));
 
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -1413,17 +1413,17 @@ DEFINE_REGISTER_SIZE_OF_TAB(NonJS);
 
 }
 
 #if defined(MOZ_DMD)
 
 namespace mozilla {
 namespace dmd {
 
-class NullReporterCallback : public nsIMemoryReporterCallback
+class NullReporterCallback MOZ_FINAL : public nsIMemoryReporterCallback
 {
 public:
     NS_DECL_ISUPPORTS
 
     NS_IMETHOD Callback(const nsACString& aProcess, const nsACString& aPath,
                         int32_t aKind, int32_t aUnits, int64_t aAmount,
                         const nsACString& aDescription,
                         nsISupports* aData)