зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1507021. Use SnappedRectangle in more places. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D11840 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ee6cbfb346
Коммит
1d2422df54
|
@ -149,10 +149,12 @@ public:
|
|||
|
||||
/**
|
||||
* Draws the rectangle given by rect.
|
||||
* @param snapToPixels ?
|
||||
*/
|
||||
void Rectangle(const gfxRect& rect, bool snapToPixels = false);
|
||||
void Rectangle(const gfxRect& rect) { return Rectangle(rect, false); }
|
||||
void SnappedRectangle(const gfxRect& rect) { return Rectangle(rect, true); }
|
||||
private:
|
||||
void Rectangle(const gfxRect& rect, bool snapToPixels);
|
||||
public:
|
||||
|
||||
/**
|
||||
** Transformation Matrix manipulation
|
||||
|
|
|
@ -562,10 +562,10 @@ struct MOZ_STACK_CLASS BufferAlphaColor {
|
|||
{
|
||||
mContext->Save();
|
||||
mContext->NewPath();
|
||||
mContext->Rectangle(gfxRect(aBounds.X() / appsPerDevUnit,
|
||||
mContext->SnappedRectangle(gfxRect(aBounds.X() / appsPerDevUnit,
|
||||
aBounds.Y() / appsPerDevUnit,
|
||||
aBounds.Width() / appsPerDevUnit,
|
||||
aBounds.Height() / appsPerDevUnit), true);
|
||||
aBounds.Height() / appsPerDevUnit));
|
||||
mContext->Clip();
|
||||
mContext->SetColor(Color(aAlphaColor.r, aAlphaColor.g, aAlphaColor.b));
|
||||
mContext->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aAlphaColor.a);
|
||||
|
|
|
@ -101,7 +101,7 @@ DisplayItemClip::ApplyRectTo(gfxContext* aContext, int32_t A2D) const
|
|||
{
|
||||
aContext->NewPath();
|
||||
gfxRect clip = nsLayoutUtils::RectToGfxRect(mClipRect, A2D);
|
||||
aContext->Rectangle(clip, true);
|
||||
aContext->SnappedRectangle(clip);
|
||||
aContext->Clip();
|
||||
}
|
||||
|
||||
|
|
|
@ -2543,7 +2543,7 @@ SetupImageLayerClip(nsCSSRendering::ImageLayerClipState& aClipState,
|
|||
|
||||
aAutoSR->EnsureSaved(aCtx);
|
||||
aCtx->NewPath();
|
||||
aCtx->Rectangle(bgAreaGfx, true);
|
||||
aCtx->SnappedRectangle(bgAreaGfx);
|
||||
aCtx->Clip();
|
||||
}
|
||||
|
||||
|
@ -2585,7 +2585,7 @@ DrawBackgroundColor(nsCSSRendering::ImageLayerClipState& aClipState,
|
|||
// table painting seems to depend on it.
|
||||
if (!aClipState.mHasRoundedCorners || aClipState.mCustomClip) {
|
||||
aCtx->NewPath();
|
||||
aCtx->Rectangle(aClipState.mDirtyRectInDevPx, true);
|
||||
aCtx->SnappedRectangle(aClipState.mDirtyRectInDevPx);
|
||||
aCtx->Fill();
|
||||
return;
|
||||
}
|
||||
|
@ -2606,7 +2606,7 @@ DrawBackgroundColor(nsCSSRendering::ImageLayerClipState& aClipState,
|
|||
gfxRect dirty = ThebesRect(bgAreaGfx).Intersect(aClipState.mDirtyRectInDevPx);
|
||||
|
||||
aCtx->NewPath();
|
||||
aCtx->Rectangle(dirty, true);
|
||||
aCtx->SnappedRectangle(dirty);
|
||||
aCtx->Clip();
|
||||
|
||||
if (aClipState.mHasAdditionalBGClipArea) {
|
||||
|
@ -2615,7 +2615,7 @@ DrawBackgroundColor(nsCSSRendering::ImageLayerClipState& aClipState,
|
|||
bgAdditionalAreaGfx.Round();
|
||||
gfxUtils::ConditionRect(bgAdditionalAreaGfx);
|
||||
aCtx->NewPath();
|
||||
aCtx->Rectangle(bgAdditionalAreaGfx, true);
|
||||
aCtx->SnappedRectangle(bgAdditionalAreaGfx);
|
||||
aCtx->Clip();
|
||||
}
|
||||
|
||||
|
|
|
@ -5079,7 +5079,7 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
ctx->SetColor(mColor);
|
||||
ctx->NewPath();
|
||||
ctx->Rectangle(bounds, true);
|
||||
ctx->SnappedRectangle(bounds);
|
||||
ctx->Fill();
|
||||
ctx->PopGroupAndBlend();
|
||||
return;
|
||||
|
@ -5087,7 +5087,7 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
ctx->SetColor(mColor);
|
||||
ctx->NewPath();
|
||||
ctx->Rectangle(bounds, true);
|
||||
ctx->SnappedRectangle(bounds);
|
||||
ctx->Fill();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1053,7 +1053,7 @@ void PaintMaskAndClipPathInternal(const PaintFramesParams& aParams, const T& aPa
|
|||
gfxRect drawingRect =
|
||||
nsLayoutUtils::RectToGfxRect(aParams.borderArea,
|
||||
frame->PresContext()->AppUnitsPerDevPixel());
|
||||
context.Rectangle(drawingRect, true);
|
||||
context.SnappedRectangle(drawingRect);
|
||||
Color overlayColor(0.0f, 0.0f, 0.0f, 0.8f);
|
||||
if (maskUsage.shouldGenerateMaskLayer) {
|
||||
overlayColor.r = 1.0f; // red represents css positioned mask.
|
||||
|
|
Загрузка…
Ссылка в новой задаче