From 14879d50bcfe2f90dfceb96861b745c47ac7aaa9 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 10 Dec 2013 14:50:41 +0100 Subject: [PATCH] Bug 945655 - Composite filters with operator IN have a result that is the intersection of the input rects, not the union. FilterNodeSoftware part. r=roc --- gfx/2d/FilterNodeSoftware.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gfx/2d/FilterNodeSoftware.cpp b/gfx/2d/FilterNodeSoftware.cpp index 1baa66fda80..840bd719c35 100644 --- a/gfx/2d/FilterNodeSoftware.cpp +++ b/gfx/2d/FilterNodeSoftware.cpp @@ -2652,7 +2652,12 @@ FilterNodeCompositeSoftware::GetOutputRectInRect(const IntRect& aRect) { IntRect rect; for (size_t inputIndex = 0; inputIndex < NumberOfSetInputs(); inputIndex++) { - rect = rect.Union(GetInputRectInRect(IN_COMPOSITE_IN_START + inputIndex, aRect)); + IntRect inputRect = GetInputRectInRect(IN_COMPOSITE_IN_START + inputIndex, aRect); + if (mOperator == COMPOSITE_OPERATOR_IN && inputIndex > 0) { + rect = rect.Intersect(inputRect); + } else { + rect = rect.Union(inputRect); + } } return rect; }