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, a=lsblakk
authorMarkus Stange <mstange@themasta.com>
Tue, 10 Dec 2013 14:50:41 +0100
changeset 175486 96bd2d5ba2e236df319596c12232c15df05ab07a
parent 175485 4321400b4a7cf2307d0650f2d4c49ded2f776947
child 175487 4268a977d5206324c44dbb9d5328144855220d7b
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs945655
milestone28.0a2
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, a=lsblakk
gfx/2d/FilterNodeSoftware.cpp
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -2647,17 +2647,22 @@ FilterNodeCompositeSoftware::RequestFrom
   }
 }
 
 IntRect
 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;
 }
 
 int32_t
 FilterNodeBlurXYSoftware::InputIndex(uint32_t aInputEnumIndex)
 {
   switch (aInputEnumIndex) {