Bug 756601 - Setup PaintWillResample correctly. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 10 May 2013 09:02:49 +1200
changeset 138214 1e746a304a6fd50a758be0022733b2193da6c072
parent 138213 789f09e5ce7caa3f3cab0a2b266887f30fa40a6e
child 138215 74ff7b69c638b51c49c98fba397b5700292ff582
push id3752
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 17:21:10 +0000
treeherdermozilla-aurora@1580544aef0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs756601
milestone23.0a1
Bug 756601 - Setup PaintWillResample correctly. r=roc
gfx/layers/composite/ContentHost.h
gfx/layers/composite/ThebesLayerComposite.cpp
--- a/gfx/layers/composite/ContentHost.h
+++ b/gfx/layers/composite/ContentHost.h
@@ -32,16 +32,18 @@ public:
   virtual void UpdateThebes(const ThebesBufferData& aData,
                             const nsIntRegion& aUpdated,
                             const nsIntRegion& aOldValidRegionBack,
                             nsIntRegion* aUpdatedRegionBack) = 0;
 
 #ifdef MOZ_DUMP_PAINTING
   virtual already_AddRefed<gfxImageSurface> Dump() { return nullptr; }
 #endif
+  
+  virtual void SetPaintWillResample(bool aResample) { }
 
 protected:
   ContentHost(const TextureInfo& aTextureInfo)
     : CompositableHost(aTextureInfo)
   {}
 };
 
 /**
@@ -94,17 +96,17 @@ public:
   virtual already_AddRefed<gfxImageSurface> Dump()
   {
     return mTextureHost->Dump();
   }
 #endif
 
   virtual TextureHost* GetTextureHost() MOZ_OVERRIDE;
 
-  void SetPaintWillResample(bool aResample) { mPaintWillResample = aResample; }
+  virtual void SetPaintWillResample(bool aResample) { mPaintWillResample = aResample; }
   // The client has destroyed its texture clients and we should destroy our
   // texture hosts and SurfaceDescriptors. Note that we don't immediately
   // destroy our front buffer so that we can continue to composite.
   virtual void DestroyTextures() = 0;
 
 protected:
   virtual nsIntPoint GetOriginOffset()
   {
--- a/gfx/layers/composite/ThebesLayerComposite.cpp
+++ b/gfx/layers/composite/ThebesLayerComposite.cpp
@@ -118,16 +118,18 @@ ThebesLayerComposite::RenderLayer(const 
     tiledLayerProps.mVisibleRegion = visibleRegion;
     tiledLayerProps.mDisplayPort = GetDisplayPort();
     tiledLayerProps.mEffectiveResolution = GetEffectiveResolution();
     tiledLayerProps.mCompositionBounds = GetCompositionBounds();
     tiledLayerProps.mRetainTiles = !mIsFixedPosition;
     tiledLayerProps.mValidRegion = mValidRegion;
   }
 
+  mBuffer->SetPaintWillResample(MayResample());
+
   mBuffer->Composite(effectChain,
                      GetEffectiveOpacity(),
                      transform,
                      gfx::Point(aOffset.x, aOffset.y),
                      gfx::FILTER_LINEAR,
                      clipRect,
                      &visibleRegion,
                      mRequiresTiledProperties ? &tiledLayerProps