Bug 1484101 - Ensure DrawTargetTiled::PadEdges is called with region in device space. r=rhunt
authorJamie Nicol <jnicol@mozilla.com>
Wed, 22 Aug 2018 16:29:52 +0000
changeset 488032 e65592761f4cb4562a194cd2bc5c9c907e13f898
parent 488031 3dd6ba40f3bf51dc3513c0ad88c86f62473330b6
child 488033 202f0986f4599698554946394d878597b7263484
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt
bugs1484101
milestone63.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 1484101 - Ensure DrawTargetTiled::PadEdges is called with region in device space. r=rhunt In MultiTiledContentClient we can create a DrawTargetTiled with a different origin than the layer we are painting. We must therefore ensure when edge-padding that we provide the valid region in the draw target's device-space rather than layer-space. Not doing so was causing us to pad out in incorrect directions, causing visible seams. Differential Revision: https://phabricator.services.mozilla.com/D3993
gfx/2d/2D.h
gfx/layers/client/MultiTiledContentClient.cpp
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -1295,16 +1295,17 @@ public:
   /**
    * Perform an in-place blur operation. This is only supported on data draw
    * targets.
    */
   virtual void Blur(const AlphaBoxBlur& aBlur);
 
   /**
    * Performs an in-place edge padding operation.
+   * aRegion is specified in device space.
    */
   virtual void PadEdges(const IntRegion& aRegion);
 
   /**
    * Performs an in-place buffer unrotation operation.
    */
   virtual bool Unrotate(IntPoint aRotation);
 
--- a/gfx/layers/client/MultiTiledContentClient.cpp
+++ b/gfx/layers/client/MultiTiledContentClient.cpp
@@ -265,17 +265,17 @@ void ClientMultiTiledLayerBuffer::Update
         ctx->CurrentMatrix().PreScale(mResolution, mResolution).PreTranslate(-mTilingOrigin));
 
       mCallback(&mPaintedLayer, ctx, paintRegion, dirtyRegion,
                 DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
       ctx = nullptr;
 
       // Edge padding allows us to avoid resampling artifacts
       if (gfxPrefs::TileEdgePaddingEnabled() && mResolution == 1) {
-        drawTarget->PadEdges(newValidRegion);
+        drawTarget->PadEdges(newValidRegion.MovedBy(-mTilingOrigin));
       }
 
       // Reset
       mPaintTiles.clear();
       mTilingOrigin = IntPoint(std::numeric_limits<int32_t>::max(),
                                std::numeric_limits<int32_t>::max());
     }