aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_DAAPath.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-08-31 16:38:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-01 15:03:47 +0000
commit867017de0cd9d2104a291ddd6d6eef808edd82b6 (patch)
tree8ac0ad063914fd657db2211f36d06f559af8cb2f /src/core/SkScan_DAAPath.cpp
parent9d4c9296648e11d91354cab5570cdf1b0b2f91bc (diff)
Use SkSTArenaAlloc to handle the stack memory of the delta list
Bug: skia: Change-Id: I5c98220498c71ced4565f492335cef2a372d0765 Reviewed-on: https://skia-review.googlesource.com/41743 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkScan_DAAPath.cpp')
-rw-r--r--src/core/SkScan_DAAPath.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/SkScan_DAAPath.cpp b/src/core/SkScan_DAAPath.cpp
index de24e49bcd..4681fa1b59 100644
--- a/src/core/SkScan_DAAPath.cpp
+++ b/src/core/SkScan_DAAPath.cpp
@@ -346,7 +346,12 @@ void SkScan::DAAFillPath(const SkPath& path, const SkRegion& origClip, SkBlitter
deltaMask.convertCoverageToAlpha(isEvenOdd, isInverse, isConvex);
blitter->blitMask(deltaMask.prepareSkMask(), clippedIR);
} else {
- SkCoverageDeltaAllocator alloc;
+#ifdef GOOGLE3
+ constexpr int STACK_SIZE = 8 << 10; // 8K stack size alloc; Google3 has 16K limit.
+#else
+ constexpr int STACK_SIZE = 64 << 10; // 64k stack size to avoid heap allocation
+#endif
+ SkSTArenaAlloc<STACK_SIZE> alloc; // avoid heap allocation with SkSTArenaAlloc
SkCoverageDeltaList deltaList(&alloc, clippedIR.fTop, clippedIR.fBottom, forceRLE);
gen_alpha_deltas(path, *clipRgn, deltaList, blitter, skipRect, clipRect == nullptr);
blitter->blitCoverageDeltas(&deltaList, clipBounds, isEvenOdd, isInverse, isConvex);