diff options
author | Yuqian Li <liyuqian@google.com> | 2017-09-01 15:38:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-01 20:10:49 +0000 |
commit | bd40a5bf5bef1ebb5400f0cf087a420a98bb707b (patch) | |
tree | 0f598ee6f0c71bc49a1b1699165a2f33071705d5 /src/core/SkCoverageDelta.h | |
parent | b7da7239f73554abebc579a1525e1f4993fee8d8 (diff) |
Use SkSTArenaAlloc to manage SkCoverageDeltaMask's stack memory
This way, we could have more stack memory on Google3: if each of the
two branche has 12K stack memory, Google3 would believe that it needs 24K
stack memory; but using SkSTArenaAlloc, we could use 12K stack memory to
handle those two branches.
Bug: skia:
Change-Id: Ie9234226cd4ba93b5be2ebeb95ab771031354f97
Reviewed-on: https://skia-review.googlesource.com/42101
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkCoverageDelta.h')
-rw-r--r-- | src/core/SkCoverageDelta.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/SkCoverageDelta.h b/src/core/SkCoverageDelta.h index 03cb4ff241..282bf7afd8 100644 --- a/src/core/SkCoverageDelta.h +++ b/src/core/SkCoverageDelta.h @@ -117,13 +117,14 @@ public: #else static constexpr int MAX_MASK_SIZE = 2048; #endif + static constexpr int MAX_SIZE = MAX_MASK_SIZE * (sizeof(SkFixed) + sizeof(SkAlpha)); // Expand PADDING on both sides, and make it a multiple of SIMD_WIDTH static int ExpandWidth(int width); static bool CanHandle(const SkIRect& bounds); // whether bounds fits into MAX_MASK_SIZE static bool Suitable(const SkIRect& bounds); // CanHandle(bounds) && width <= SUITABLE_WIDTH - SkCoverageDeltaMask(const SkIRect& bounds); + SkCoverageDeltaMask(SkArenaAlloc* alloc, const SkIRect& bounds); int top() const { return fBounds.fTop; } int bottom() const { return fBounds.fBottom; } @@ -155,9 +156,9 @@ public: private: SkIRect fBounds; - SkFixed fDeltaStorage[MAX_MASK_SIZE]; + SkFixed* fDeltaStorage; SkFixed* fDeltas; - SkAlpha fMask[MAX_MASK_SIZE]; + SkAlpha* fMask; int fExpandedWidth; SkAntiRect fAntiRect; |