forked from mirrors/gecko-dev
Bug 1755975 - Pass rect or path directly to Clip() instead of manually creating a path. r=gfx-reviewers,mstange
Differential Revision: https://phabricator.services.mozilla.com/D139038
This commit is contained in:
parent
f1ad25621f
commit
ee8edce30e
4 changed files with 4 additions and 12 deletions
|
|
@ -264,9 +264,7 @@ bool SVGDrawingCallback::operator()(gfxContext* aContext,
|
||||||
gfxContextAutoSaveRestore contextRestorer(aContext);
|
gfxContextAutoSaveRestore contextRestorer(aContext);
|
||||||
|
|
||||||
// Clip to aFillRect so that we don't paint outside.
|
// Clip to aFillRect so that we don't paint outside.
|
||||||
aContext->NewPath();
|
aContext->Clip(aFillRect);
|
||||||
aContext->Rectangle(aFillRect);
|
|
||||||
aContext->Clip();
|
|
||||||
|
|
||||||
gfxMatrix matrix = aTransform;
|
gfxMatrix matrix = aTransform;
|
||||||
if (!matrix.Invert()) {
|
if (!matrix.Invert()) {
|
||||||
|
|
|
||||||
|
|
@ -7575,9 +7575,7 @@ void nsDisplayText::RenderToContext(gfxContext* aCtx,
|
||||||
|
|
||||||
bool willClip = !aBuilder->IsForGenerateGlyphMask() && !aIsRecording;
|
bool willClip = !aBuilder->IsForGenerateGlyphMask() && !aIsRecording;
|
||||||
if (willClip) {
|
if (willClip) {
|
||||||
aCtx->NewPath();
|
aCtx->Clip(pixelVisible);
|
||||||
aCtx->Rectangle(pixelVisible);
|
|
||||||
aCtx->Clip();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(mVisIStartEdge >= 0, "illegal start edge");
|
NS_ASSERTION(mVisIStartEdge >= 0, "illegal start edge");
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,12 @@ namespace mozilla {
|
||||||
/* static*/
|
/* static*/
|
||||||
void CSSClipPathInstance::ApplyBasicShapeOrPathClip(
|
void CSSClipPathInstance::ApplyBasicShapeOrPathClip(
|
||||||
gfxContext& aContext, nsIFrame* aFrame, const gfxMatrix& aTransform) {
|
gfxContext& aContext, nsIFrame* aFrame, const gfxMatrix& aTransform) {
|
||||||
aContext.NewPath();
|
|
||||||
RefPtr<Path> path =
|
RefPtr<Path> path =
|
||||||
CreateClipPathForFrame(aContext.GetDrawTarget(), aFrame, aTransform);
|
CreateClipPathForFrame(aContext.GetDrawTarget(), aFrame, aTransform);
|
||||||
if (!path) {
|
if (!path) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aContext.SetPath(path);
|
aContext.Clip(path);
|
||||||
aContext.Clip();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static*/
|
/* static*/
|
||||||
|
|
|
||||||
|
|
@ -1180,9 +1180,7 @@ bool PaintFrameCallback::operator()(gfxContext* aContext,
|
||||||
aContext->Save();
|
aContext->Save();
|
||||||
|
|
||||||
// Clip to aFillRect so that we don't paint outside.
|
// Clip to aFillRect so that we don't paint outside.
|
||||||
aContext->NewPath();
|
aContext->Clip(aFillRect);
|
||||||
aContext->Rectangle(aFillRect);
|
|
||||||
aContext->Clip();
|
|
||||||
|
|
||||||
gfxMatrix invmatrix = aTransform;
|
gfxMatrix invmatrix = aTransform;
|
||||||
if (!invmatrix.Invert()) {
|
if (!invmatrix.Invert()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue