Commit 789c5410 authored by Wes Kocher's avatar Wes Kocher
Browse files

Backed out 2 changesets (bug 1048110) for various Android mochitest failures on a CLOSED TREE

Backed out changeset 1cf6f4f27811 (bug 1048110)
Backed out changeset b89f54e21c0b (bug 1048110)
parent 4c2c3423
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -204,20 +204,6 @@ struct BaseRect {
  }
  void Inflate(const SizeT& aSize) { Inflate(aSize.width, aSize.height); }

  void InflateToMultiple(const SizeT& aMultiple)
  {
    T xMost = XMost();
    T yMost = YMost();

    x = static_cast<T>(floor(x / aMultiple.width)) * aMultiple.width;
    y = static_cast<T>(floor(y / aMultiple.height)) * aMultiple.height;
    xMost = static_cast<T>(ceil(x / aMultiple.width)) * aMultiple.width;
    yMost = static_cast<T>(ceil(y / aMultiple.height)) * aMultiple.height;

    width = xMost - x;
    height = yMost - y;
  }

  void Deflate(T aD) { Deflate(aD, aD); }
  void Deflate(T aDx, T aDy)
  {
+8 −8
Original line number Diff line number Diff line
@@ -1434,14 +1434,6 @@ public:

  virtual int32_t GetMaxLayerSize() { return Manager()->GetMaxTextureSize(); }

  /**
   * Returns true if this layer's effective transform is not just
   * a translation by integers, or if this layer or some ancestor layer
   * is marked as having a transform that may change without a full layer
   * transaction.
   */
  bool MayResample();

protected:
  Layer(LayerManager* aManager, void* aImplData);

@@ -1490,6 +1482,14 @@ protected:
                               const gfxRect& aSnapRect,
                               gfx::Matrix* aResidualTransform);

  /**
   * Returns true if this layer's effective transform is not just
   * a translation by integers, or if this layer or some ancestor layer
   * is marked as having a transform that may change without a full layer
   * transaction.
   */
  bool MayResample();

  LayerManager* mManager;
  ContainerLayer* mParent;
  Layer* mNextSibling;
+4 −19
Original line number Diff line number Diff line
@@ -335,23 +335,8 @@ ClientTiledThebesLayer::RenderLayer()
  TILING_LOG("TILING %p: Initial valid region %s\n", this, Stringify(mValidRegion).c_str());
  TILING_LOG("TILING %p: Initial low-precision valid region %s\n", this, Stringify(mLowPrecisionValidRegion).c_str());

  nsIntRegion neededRegion = mVisibleRegion;
  if (MayResample()) {
    // If we're resampling then bilinear filtering can read up to 1 pixel
    // outside of our texture coords. Make the visible region a single rect,
    // and pad it out by 1 pixel (restricted to tile boundaries) so that
    // we always have valid content or transparent pixels to sample from.
    nsIntRect bounds = neededRegion.GetBounds();
    nsIntRect wholeTiles = bounds;
    wholeTiles.Inflate(nsIntSize(gfxPrefs::LayersTileWidth(), gfxPrefs::LayersTileHeight()));
    nsIntRect padded = bounds;
    padded.Inflate(1);
    padded.IntersectRect(padded, wholeTiles);
    neededRegion = padded;
  }

  nsIntRegion invalidRegion;
  invalidRegion.Sub(neededRegion, mValidRegion);
  invalidRegion.Sub(mVisibleRegion, mValidRegion);
  if (invalidRegion.IsEmpty()) {
    EndPaint();
    return;
@@ -366,7 +351,7 @@ ClientTiledThebesLayer::RenderLayer()
    // In some cases we can take a fast path and just be done with it.
    if (UseFastPath()) {
      TILING_LOG("TILING %p: Taking fast-path\n", this);
      mValidRegion = neededRegion;
      mValidRegion = mVisibleRegion;
      mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, callback, data);
      ClientManager()->Hold(this);
      mContentClient->UseTiledLayerBuffer(TiledContentClient::TILED_BUFFER);
@@ -383,7 +368,7 @@ ClientTiledThebesLayer::RenderLayer()
    // Make sure that tiles that fall outside of the visible region or outside of the
    // critical displayport are discarded on the first update. Also make sure that we
    // only draw stuff inside the critical displayport on the first update.
    mValidRegion.And(mValidRegion, neededRegion);
    mValidRegion.And(mValidRegion, mVisibleRegion);
    if (!mPaintData.mCriticalDisplayPort.IsEmpty()) {
      mValidRegion.And(mValidRegion, LayerIntRect::ToUntyped(mPaintData.mCriticalDisplayPort));
      invalidRegion.And(invalidRegion, LayerIntRect::ToUntyped(mPaintData.mCriticalDisplayPort));
@@ -402,7 +387,7 @@ ClientTiledThebesLayer::RenderLayer()
  if (gfxPrefs::UseLowPrecisionBuffer()) {
    // Calculate the invalid region for the low precision buffer. Make sure
    // to remove the valid high-precision area so we don't double-paint it.
    lowPrecisionInvalidRegion.Sub(neededRegion, mLowPrecisionValidRegion);
    lowPrecisionInvalidRegion.Sub(mVisibleRegion, mLowPrecisionValidRegion);
    lowPrecisionInvalidRegion.Sub(lowPrecisionInvalidRegion, mValidRegion);
  }
  TILING_LOG("TILING %p: Low-precision invalid region %s\n", this, Stringify(lowPrecisionInvalidRegion).c_str());
+0 −5
Original line number Diff line number Diff line
@@ -327,11 +327,6 @@ ClientTiledLayerBuffer::GetContentType(SurfaceMode* aMode) const
        content = gfxContentType::COLOR;
      }
#endif
  } else if (mode == SurfaceMode::SURFACE_OPAQUE) {
    if (mThebesLayer->MayResample()) {
      mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
      content = gfxContentType::COLOR_ALPHA;
    }
  }

  if (aMode) {
+10 −1
Original line number Diff line number Diff line
@@ -37,6 +37,14 @@ class DataSourceSurface;

namespace layers {

// Some properties of a Layer required for tiling
struct TiledLayerProperties
{
  nsIntRegion mVisibleRegion;
  nsIntRegion mValidRegion;
  CSSToScreenScale mEffectiveResolution;
};

class Layer;
class SurfaceDescriptor;
class Compositor;
@@ -113,7 +121,8 @@ public:
                         const gfx::Matrix4x4& aTransform,
                         const gfx::Filter& aFilter,
                         const gfx::Rect& aClipRect,
                         const nsIntRegion* aVisibleRegion = nullptr) = 0;
                         const nsIntRegion* aVisibleRegion = nullptr,
                         TiledLayerProperties* aLayerProperties = nullptr) = 0;

  /**
   * Update the content host.
Loading