Bug 946958 part 1. Remove GetWidgetSize. r=mattwoodrow
authorNicholas Cameron <ncameron@mozilla.com>
Mon, 09 Dec 2013 14:40:59 +1300
changeset 175655 b341049f5f4728a1a90401e3964880cc5f902897
parent 175654 8927d5297df192032ddc29042dff0e2b467173e5
child 175656 c79d9a33dd43b8d14c8eb1ddbfc2c1eed8323e51
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs946958
milestone29.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 946958 part 1. Remove GetWidgetSize. r=mattwoodrow
gfx/layers/Compositor.h
gfx/layers/basic/BasicCompositor.cpp
gfx/layers/basic/BasicCompositor.h
gfx/layers/composite/LayerManagerComposite.cpp
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/d3d11/CompositorD3D11.h
gfx/layers/d3d9/CompositorD3D9.h
gfx/layers/opengl/CompositorOGL.h
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -426,17 +426,16 @@ public:
    * Call before rendering begins to ensure the compositor is ready to
    * composite. Returns false if rendering should be aborted.
    */
   virtual bool Ready() { return true; }
 
   // XXX I expect we will want to move mWidget into this class and implement
   // these methods properly.
   virtual nsIWidget* GetWidget() const { return nullptr; }
-  virtual const nsIntSize& GetWidgetSize() = 0;
 
   // Call before and after any rendering not done by this compositor but which
   // might affect the compositor's internal state or the state of any APIs it
   // uses. For example, internal GL state.
   virtual void SaveState() {}
   virtual void RestoreState() {}
 
   /**
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -215,17 +215,16 @@ CreateBasicDeprecatedTextureHost(Surface
   }
 
   result->SetFlags(aTextureFlags);
   return result.forget();
 }
 
 BasicCompositor::BasicCompositor(nsIWidget *aWidget)
   : mWidget(aWidget)
-  , mWidgetSize(-1, -1)
 {
   MOZ_COUNT_CTOR(BasicCompositor);
   sBackend = LAYERS_BASIC;
 }
 
 BasicCompositor::~BasicCompositor()
 {
   MOZ_COUNT_DTOR(BasicCompositor);
@@ -535,17 +534,16 @@ BasicCompositor::BeginFrame(const nsIntR
                             const gfxMatrix& aTransform,
                             const gfx::Rect& aRenderBounds,
                             gfx::Rect *aClipRectOut /* = nullptr */,
                             gfx::Rect *aRenderBoundsOut /* = nullptr */)
 {
   nsIntRect intRect;
   mWidget->GetClientBounds(intRect);
   Rect rect = Rect(0, 0, intRect.width, intRect.height);
-  mWidgetSize = intRect.Size();
 
   nsIntRect invalidRect = aInvalidRegion.GetBounds();
   mInvalidRect = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height);
   mInvalidRegion = aInvalidRegion;
 
   if (aRenderBoundsOut) {
     *aRenderBoundsOut = Rect();
   }
--- a/gfx/layers/basic/BasicCompositor.h
+++ b/gfx/layers/basic/BasicCompositor.h
@@ -114,20 +114,16 @@ public:
   virtual void PrepareViewport(const gfx::IntSize& aSize,
                                const gfxMatrix& aWorldTransform) MOZ_OVERRIDE { }
 
   virtual void NotifyLayersTransaction() MOZ_OVERRIDE { }
 
   virtual const char* Name() const { return "Basic"; }
 
   virtual nsIWidget* GetWidget() const MOZ_OVERRIDE { return mWidget; }
-  virtual const nsIntSize& GetWidgetSize() MOZ_OVERRIDE
-  {
-    return mWidgetSize;
-  }
 
   gfx::DrawTarget *GetDrawTarget() { return mDrawTarget; }
 
 private:
   // Widget associated with this compositor
   nsIWidget *mWidget;
   nsIntSize mWidgetSize;
 
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -781,22 +781,16 @@ void
 LayerComposite::Destroy()
 {
   if (!mDestroyed) {
     mDestroyed = true;
     CleanupResources();
   }
 }
 
-const nsIntSize&
-LayerManagerComposite::GetWidgetSize()
-{
-  return mCompositor->GetWidgetSize();
-}
-
 void
 LayerManagerComposite::SetCompositorID(uint32_t aID)
 {
   NS_ASSERTION(mCompositor, "No compositor");
   mCompositor->SetCompositorID(aID);
 }
 
 void
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -193,18 +193,16 @@ public:
   /**
    * Creates a DrawTarget which is optimized for inter-operating with this
    * layermanager.
    */
   virtual TemporaryRef<mozilla::gfx::DrawTarget>
     CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
                      mozilla::gfx::SurfaceFormat aFormat) MOZ_OVERRIDE;
 
-  const nsIntSize& GetWidgetSize();
-
   /**
    * Calculates the 'completeness' of the rendering that intersected with the
    * screen on the last render. This is only useful when progressive tile
    * drawing is enabled, otherwise this will always return 1.0.
    * This function's expense scales with the size of the layer tree and the
    * complexity of individual layers' valid regions.
    */
   float ComputeRenderIntegrity();
--- a/gfx/layers/d3d11/CompositorD3D11.h
+++ b/gfx/layers/d3d11/CompositorD3D11.h
@@ -134,24 +134,16 @@ public:
 
 #ifdef MOZ_DUMP_PAINTING
   virtual const char* Name() const MOZ_OVERRIDE { return "Direct3D 11"; }
 #endif
 
   virtual void NotifyLayersTransaction() MOZ_OVERRIDE { }
 
   virtual nsIWidget* GetWidget() const MOZ_OVERRIDE { return mWidget; }
-  virtual const nsIntSize& GetWidgetSize() MOZ_OVERRIDE
-  {
-    NS_ASSERTION(false, "Getting the widget size on windows causes some kind of resizing of buffers. "
-                        "You should not do that outside of BeginFrame, so the best we can do is return "
-                        "the last size we got, that might not be up to date. So you probably shouldn't "
-                        "use this method.");
-    return mSize;
-  }
 
   ID3D11Device* GetDevice() { return mDevice; }
 
 private:
   // ensure mSize is up to date with respect to mWidget
   void EnsureSize();
   void VerifyBufferSize();
   void UpdateRenderTarget();
--- a/gfx/layers/d3d9/CompositorD3D9.h
+++ b/gfx/layers/d3d9/CompositorD3D9.h
@@ -81,24 +81,16 @@ public:
 
 #ifdef MOZ_DUMP_PAINTING
   virtual const char* Name() const MOZ_OVERRIDE { return "Direct3D9"; }
 #endif
 
   virtual void NotifyLayersTransaction() MOZ_OVERRIDE {}
 
   virtual nsIWidget* GetWidget() const MOZ_OVERRIDE { return mWidget; }
-  virtual const nsIntSize& GetWidgetSize() MOZ_OVERRIDE
-  {
-    NS_ASSERTION(false, "Getting the widget size on windows causes some kind of resizing of buffers. "
-                        "You should not do that outside of BeginFrame, so the best we can do is return "
-                        "the last size we got, that might not be up to date. So you probably shouldn't "
-                        "use this method.");
-    return mSize;
-  }
 
   IDirect3DDevice9* device() const
   {
     return mDeviceManager
            ? mDeviceManager->device()
            : nullptr;
   }
 
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -153,19 +153,16 @@ public:
 #endif // MOZ_DUMP_PAINTING
 
   virtual void NotifyLayersTransaction() MOZ_OVERRIDE;
 
   virtual void Pause() MOZ_OVERRIDE;
   virtual bool Resume() MOZ_OVERRIDE;
 
   virtual nsIWidget* GetWidget() const MOZ_OVERRIDE { return mWidget; }
-  virtual const nsIntSize& GetWidgetSize() MOZ_OVERRIDE {
-    return mWidgetSize;
-  }
 
   GLContext* gl() const { return mGLContext; }
   ShaderProgramType GetFBOLayerProgramType() const {
     return mFBOTextureTarget == LOCAL_GL_TEXTURE_RECTANGLE_ARB ?
            RGBARectLayerProgramType : RGBALayerProgramType;
   }
   gfx::SurfaceFormat GetFBOFormat() const {
     return gfx::FORMAT_R8G8B8A8;