Bug 1576356 - Use an AutoTArray to collect intercepts, to avoid heap allocation except in extreme cases. r=dholbert
authorJonathan Kew <jkew@mozilla.com>
Mon, 26 Aug 2019 18:14:16 +0000
changeset 553685 4db791aec1af4bfc925e098247b72632f4b6e767
parent 553684 62f65a803580fe989ce8542a93c2b4a047a4840d
child 553686 0c92114a077ef4fc021f55515f122f2e7933ec2c
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1576356
milestone70.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 1576356 - Use an AutoTArray to collect intercepts, to avoid heap allocation except in extreme cases. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D43331
layout/painting/nsCSSRendering.cpp
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -4073,17 +4073,17 @@ void nsCSSRendering::PaintDecorationLine
   SkPoint textPos = {0, 0};
   SkScalar bounds[] = {0, 0};
   Float oneCSSPixel = aFrame->PresContext()->CSSPixelsToDevPixels(1.0f);
   if (!textRun->UseCenterBaseline()) {
     GetPositioning(aParams, rect, oneCSSPixel, 0, bounds);
   }
 
   // array for the text intercepts
-  nsTArray<SkScalar> intercepts;
+  AutoTArray<SkScalar, 256> intercepts;
 
   // array for spacing data
   AutoTArray<gfxTextRun::PropertyProvider::Spacing, 64> spacing;
   spacing.SetLength(aParams.glyphRange.Length());
   if (aParams.provider != nullptr) {
     aParams.provider->GetSpacing(aParams.glyphRange, spacing.Elements());
   }