Bug 1370757 - Only push device aligned clips. r=lsalzman

The new clip from bug 1364007 can cause us to clip to a rectangle that's not
aligned to device pixels. With the current rect inflation, we didn't notice,
but if we want to remove the inflation then we need to make sure to round out
the rect that we clip to.

MozReview-Commit-ID: BO9zds8fiKI

--HG--
extra : rebase_source : f71f283ef73cf58dbc2cc05d06ea9bc864fd5084
This commit is contained in:
Markus Stange 2017-06-06 19:19:51 -04:00
parent 9f3268689a
commit 1cdb518fb7

View File

@ -50,6 +50,12 @@ gfxQuartzNativeDrawing::BeginNativeDrawing()
} else {
// Clip the DT in case BorrowedCGContext needs to create a new layer.
// This prevents it from creating a new layer the size of the window.
// But make sure that this clip is device pixel aligned.
Matrix transform = dt->GetTransform();
Rect deviceRect = transform.TransformBounds(mNativeRect);
deviceRect.RoundOut();
mNativeRect = transform.Inverse().TransformBounds(deviceRect);
mDrawTarget->PushClipRect(mNativeRect);
}