Bug 637852. Part 10: Remove mX/YResolution from ThebesLayer. r=joe
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 23 Jun 2011 00:11:28 +1200
changeset 71525 5b2a58c9c279d1a6e27c8fba6cb24c931063dcf5
parent 71524 123d2c2f626066e8b5d393ea13da451e09594ea3
child 71526 a63a96b9571e572d0f0ca4272f6c48a9cb3a35c6
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs637852
milestone7.0a1
Bug 637852. Part 10: Remove mX/YResolution from ThebesLayer. r=joe These are the last vestiges of Layer-based resolution API.
gfx/layers/Layers.cpp
gfx/layers/Layers.h
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -566,19 +566,16 @@ Layer::PrintInfo(nsACString& aTo, const 
 
 nsACString&
 ThebesLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
 {
   Layer::PrintInfo(aTo, aPrefix);
   if (!mValidRegion.IsEmpty()) {
     AppendToString(aTo, mValidRegion, " [valid=", "]");
   }
-  if (mXResolution != 1.0 || mYResolution != 1.0) {
-    aTo.AppendPrintf(" [xres=%g yres=%g]", mXResolution, mYResolution);
-  }
   return aTo;
 }
 
 nsACString&
 ContainerLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
 {
   Layer::PrintInfo(aTo, aPrefix);
   if (!mFrameMetrics.IsDefault()) {
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -943,18 +943,16 @@ public:
    * region.
    */
   virtual void InvalidateRegion(const nsIntRegion& aRegion) = 0;
 
   /**
    * Can be used anytime
    */
   const nsIntRegion& GetValidRegion() const { return mValidRegion; }
-  float GetXResolution() const { return mXResolution; }
-  float GetYResolution() const { return mYResolution; }
 
   virtual ThebesLayer* AsThebesLayer() { return this; }
 
   MOZ_LAYER_DECL_NAME("ThebesLayer", TYPE_THEBES)
 
   virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface)
   {
     // The default implementation just snaps 0,0 to pixels.
@@ -964,41 +962,24 @@ public:
 
   bool UsedForReadback() { return mUsedForReadback; }
   void SetUsedForReadback(bool aUsed) { mUsedForReadback = aUsed; }
 
 protected:
   ThebesLayer(LayerManager* aManager, void* aImplData)
     : Layer(aManager, aImplData)
     , mValidRegion()
-    , mXResolution(1.0)
-    , mYResolution(1.0)
     , mUsedForReadback(false)
   {
     mContentFlags = 0; // Clear NO_TEXT, NO_TEXT_OVER_TRANSPARENT
   }
 
   virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
 
   nsIntRegion mValidRegion;
-  // Resolution values tell this to paint its content scaled by
-  // <aXResolution, aYResolution>, into a backing buffer with
-  // dimensions scaled the same.  A non-1.0 resolution also tells this
-  // to set scaling factors that compensate for the re-paint
-  // resolution when rendering itself to render targets
-  //
-  // Resolution doesn't affect the visible region, valid region, or
-  // re-painted regions at all.  It only affects how scalable thebes
-  // content is rasterized to device pixels.
-  //
-  // Setting the resolution isn't part of the public ThebesLayer API
-  // because it's backend-specific, and it doesn't necessarily make
-  // sense for all backends to fully support it.
-  float mXResolution;
-  float mYResolution;
   /**
    * Set when this ThebesLayer is participating in readback, i.e. some
    * ReadbackLayer (may) be getting its background from this layer.
    */
   bool mUsedForReadback;
 };
 
 /**