Bug 1520294, make FilterPrimitiveDescription usage a tad less malloc heavy, r=mstange
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 16 Jan 2019 12:27:04 +0200
changeset 514074 cee37d07397cdffd16e63db1cdfff27a57d09eea
parent 514073 ed01030dd8adf3973f2c5ee1620e8e268e7ad07c
child 514075 036c3b7cde376187c8df91f7d764e528371adace
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1520294
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520294, make FilterPrimitiveDescription usage a tad less malloc heavy, r=mstange
gfx/src/FilterSupport.h
--- a/gfx/src/FilterSupport.h
+++ b/gfx/src/FilterSupport.h
@@ -13,16 +13,24 @@
 #include "mozilla/gfx/Matrix.h"
 #include "mozilla/gfx/2D.h"
 #include "nsClassHashtable.h"
 #include "nsTArray.h"
 #include "nsRegion.h"
 
 namespace mozilla {
 namespace gfx {
+class FilterPrimitiveDescription;
+} // namespace gfx
+} // namespace mozilla
+
+DECLARE_USE_COPY_CONSTRUCTORS(mozilla::gfx::FilterPrimitiveDescription)
+
+namespace mozilla {
+namespace gfx {
 
 // Morphology Operators
 const unsigned short SVG_OPERATOR_UNKNOWN = 0;
 const unsigned short SVG_OPERATOR_ERODE = 1;
 const unsigned short SVG_OPERATOR_DILATE = 2;
 
 // ColorMatrix types
 const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
@@ -456,20 +464,20 @@ class FilterPrimitiveDescription final {
 
   bool operator==(const FilterPrimitiveDescription& aOther) const;
   bool operator!=(const FilterPrimitiveDescription& aOther) const {
     return !(*this == aOther);
   }
 
  private:
   PrimitiveAttributes mAttributes;
-  nsTArray<int32_t> mInputPrimitives;
+  AutoTArray<int32_t, 2> mInputPrimitives;
   IntRect mFilterPrimitiveSubregion;
   IntRect mFilterSpaceBounds;
-  nsTArray<ColorSpace> mInputColorSpaces;
+  AutoTArray<ColorSpace, 2> mInputColorSpaces;
   ColorSpace mOutputColorSpace;
   bool mIsTainted;
 };
 
 /**
  * A data structure that contains one or more FilterPrimitiveDescriptions.
  * Designed to be serializable via IPDL, so it must not contain complex
  * functionality.