Bug 945655 - Composite filters with operator IN have a result that is the intersection of the input rects, not the union. r=roc, a=lsblakk
authorMarkus Stange <mstange@themasta.com>
Tue, 10 Dec 2013 14:50:42 +0100
changeset 175489 37c7dbcbd689e8d2890e0c2a1de58231a00b4268
parent 175488 96277064d324271b19f78b9efe14f3cddcb89da7
child 175490 27f6b16901f64718305e333419f2ebf68e55688d
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. r=roc, a=lsblakk
gfx/src/FilterSupport.cpp
--- a/gfx/src/FilterSupport.cpp
+++ b/gfx/src/FilterSupport.cpp
@@ -1264,16 +1264,19 @@ PostFilterExtentsForPrimitive(const Filt
         const nsTArray<float>& coefficients = atts.GetFloats(eCompositeCoefficients);
         MOZ_ASSERT(coefficients.Length() == 4);
         if (coefficients[3] > 0.0f) {
           // The arithmetic composite primitive can draw outside the bounding
           // box of its source images.
           return ThebesIntRect(aDescription.PrimitiveSubregion());
         }
       }
+      if (op == SVG_FECOMPOSITE_OPERATOR_IN) {
+        return aInputExtents[0].Intersect(aInputExtents[1]);
+      }
       return ResultChangeRegionForPrimitive(aDescription, aInputExtents);
     }
 
     case FilterPrimitiveDescription::eFlood:
     case FilterPrimitiveDescription::eTurbulence:
     case FilterPrimitiveDescription::eImage:
     {
       return ThebesIntRect(aDescription.PrimitiveSubregion());