Backed out 2 changesets (bug 1507021) for android build bustages on a CLOSED TREE

Backed out changeset 026f135a667f (bug 1507021)
Backed out changeset 1b87eb56e462 (bug 1507021)

--HG--
extra : amend_source : 4d51378a27f24f3d87d9b7a206c78ff962e3b663
This commit is contained in:
Andreea Pavel 2018-11-15 06:35:54 +02:00
parent 1a4cbc3c61
commit 6a58f5fcea
9 changed files with 33 additions and 39 deletions

View File

@ -791,8 +791,10 @@ InstallLayerClipPreserves3D(gfxContext* aTarget, Layer* aLayer)
transform *= oldTransform;
aTarget->SetMatrix(transform);
aTarget->SnappedClip(gfxRect(clipRect->X(), clipRect->Y(),
clipRect->Width(), clipRect->Height()));
aTarget->NewPath();
aTarget->SnappedRectangle(gfxRect(clipRect->X(), clipRect->Y(),
clipRect->Width(), clipRect->Height()));
aTarget->Clip();
aTarget->SetMatrix(oldTransform);
}
@ -945,7 +947,9 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
// Azure doesn't support EXTEND_NONE, so to avoid extending the edges
// of the source surface out to the current clip region, clip to
// the rectangle of the result surface now.
aTarget->SnappedClip(ThebesRect(xformBounds));
aTarget->NewPath();
aTarget->SnappedRectangle(ThebesRect(xformBounds));
aTarget->Clip();
FlushGroup(paintLayerContext, needsClipToVisibleRegion);
}
}

View File

@ -301,25 +301,6 @@ gfxContext::Rectangle(const gfxRect& rect, bool snapToPixels)
mPathBuilder->Close();
}
void
gfxContext::SnappedClip(const gfxRect& rect)
{
Rect rec = ToRect(rect);
gfxRect newRect(rect);
if (UserToDevicePixelSnapped(newRect, true)) {
gfxMatrix mat = ThebesMatrix(mTransform);
if (mat.Invert()) {
// We need the user space rect.
rec = ToRect(mat.TransformBounds(newRect));
} else {
rec = Rect();
}
}
Clip(rec);
}
// transform stuff
void
gfxContext::Multiply(const gfxMatrix& matrix)

View File

@ -149,12 +149,10 @@ public:
/**
* Draws the rectangle given by rect.
* @param snapToPixels ?
*/
void Rectangle(const gfxRect& rect) { return Rectangle(rect, false); }
void Rectangle(const gfxRect& rect, bool snapToPixels = false);
void SnappedRectangle(const gfxRect& rect) { return Rectangle(rect, true); }
private:
void Rectangle(const gfxRect& rect, bool snapToPixels);
public:
/**
** Transformation Matrix manipulation
@ -374,7 +372,6 @@ public:
*/
void Clip(const Rect& rect);
void Clip(const gfxRect& rect); // will clip to a rect
void SnappedClip(const gfxRect& rect); // snap rect and clip to the result
void Clip(Path* aPath);
void PopClip();

View File

@ -561,10 +561,12 @@ struct MOZ_STACK_CLASS BufferAlphaColor {
void PushSolidColor(const gfxRect& aBounds, const Color& aAlphaColor, uint32_t appsPerDevUnit)
{
mContext->Save();
mContext->SnappedClip(gfxRect(aBounds.X() / appsPerDevUnit,
mContext->NewPath();
mContext->Rectangle(gfxRect(aBounds.X() / appsPerDevUnit,
aBounds.Y() / appsPerDevUnit,
aBounds.Width() / appsPerDevUnit,
aBounds.Height() / appsPerDevUnit));
aBounds.Height() / appsPerDevUnit), true);
mContext->Clip();
mContext->SetColor(Color(aAlphaColor.r, aAlphaColor.g, aAlphaColor.b));
mContext->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aAlphaColor.a);
}

View File

@ -2116,8 +2116,10 @@ public:
const nsRect& aRect)
: mThebesContext(aThebesContext) {
mThebesContext->Save();
mThebesContext->NewPath();
gfxRect clip = nsLayoutUtils::RectToGfxRect(aRect, aAppUnitsPerGfxUnit);
mThebesContext->SnappedClip(clip);
mThebesContext->SnappedRectangle(clip);
mThebesContext->Clip();
}
~AutoPushClipRect() {
mThebesContext->Restore();

View File

@ -101,7 +101,7 @@ DisplayItemClip::ApplyRectTo(gfxContext* aContext, int32_t A2D) const
{
aContext->NewPath();
gfxRect clip = nsLayoutUtils::RectToGfxRect(mClipRect, A2D);
aContext->SnappedRectangle(clip);
aContext->Rectangle(clip, true);
aContext->Clip();
}

View File

@ -2542,7 +2542,9 @@ SetupImageLayerClip(nsCSSRendering::ImageLayerClipState& aClipState,
gfxUtils::ConditionRect(bgAreaGfx);
aAutoSR->EnsureSaved(aCtx);
aCtx->SnappedClip(bgAreaGfx);
aCtx->NewPath();
aCtx->Rectangle(bgAreaGfx, true);
aCtx->Clip();
}
if (aClipState.mHasRoundedCorners) {
@ -2583,7 +2585,7 @@ DrawBackgroundColor(nsCSSRendering::ImageLayerClipState& aClipState,
// table painting seems to depend on it.
if (!aClipState.mHasRoundedCorners || aClipState.mCustomClip) {
aCtx->NewPath();
aCtx->SnappedRectangle(aClipState.mDirtyRectInDevPx);
aCtx->Rectangle(aClipState.mDirtyRectInDevPx, true);
aCtx->Fill();
return;
}
@ -2603,14 +2605,18 @@ DrawBackgroundColor(nsCSSRendering::ImageLayerClipState& aClipState,
aCtx->Save();
gfxRect dirty = ThebesRect(bgAreaGfx).Intersect(aClipState.mDirtyRectInDevPx);
aCtx->SnappedClip(dirty);
aCtx->NewPath();
aCtx->Rectangle(dirty, true);
aCtx->Clip();
if (aClipState.mHasAdditionalBGClipArea) {
gfxRect bgAdditionalAreaGfx = nsLayoutUtils::RectToGfxRect(
aClipState.mAdditionalBGClipArea, aAppUnitsPerPixel);
bgAdditionalAreaGfx.Round();
gfxUtils::ConditionRect(bgAdditionalAreaGfx);
aCtx->SnappedClip(bgAdditionalAreaGfx);
aCtx->NewPath();
aCtx->Rectangle(bgAdditionalAreaGfx, true);
aCtx->Clip();
}
RefPtr<Path> roundedRect =
@ -2932,7 +2938,9 @@ nsCSSRendering::PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
gfxRect clip =
nsLayoutUtils::RectToGfxRect(aParams.borderArea, appUnitsPerPixel);
autoSR.EnsureSaved(&aRenderingCtx);
aRenderingCtx.SnappedClip(clip);
aRenderingCtx.NewPath();
aRenderingCtx.SnappedRectangle(clip);
aRenderingCtx.Clip();
}
}
}

View File

@ -5079,7 +5079,7 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
ctx->SetColor(mColor);
ctx->NewPath();
ctx->SnappedRectangle(bounds);
ctx->Rectangle(bounds, true);
ctx->Fill();
ctx->PopGroupAndBlend();
return;
@ -5087,7 +5087,7 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
ctx->SetColor(mColor);
ctx->NewPath();
ctx->SnappedRectangle(bounds);
ctx->Rectangle(bounds, true);
ctx->Fill();
#endif
}

View File

@ -1053,7 +1053,7 @@ void PaintMaskAndClipPathInternal(const PaintFramesParams& aParams, const T& aPa
gfxRect drawingRect =
nsLayoutUtils::RectToGfxRect(aParams.borderArea,
frame->PresContext()->AppUnitsPerDevPixel());
context.SnappedRectangle(drawingRect);
context.Rectangle(drawingRect, true);
Color overlayColor(0.0f, 0.0f, 0.0f, 0.8f);
if (maskUsage.shouldGenerateMaskLayer) {
overlayColor.r = 1.0f; // red represents css positioned mask.