prealloc room for some number of Elements to avoid malloc
authorMike Reed <reed@google.com>
Thu, 9 Mar 2017 21:39:41 +0000 (16:39 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 10 Mar 2017 00:46:02 +0000 (00:46 +0000)
commit94cbbba96f1a2a425663e631c09591023f2e48d7
treec0b2ac5cc341842cf0ad3b380fdab431f139702d
parent3304c447b953dad79fe7f355184ac13ed7e302e0
prealloc room for some number of Elements to avoid malloc

I chose 16, as in my test case from android, the depth was
at least 9. Possibly we could make it even smaller if our
underlying impl (SkDeque) would never prune its allocations,
so that we don't malloc repeatedly if we save/restore/save/restore
across the boundary of the first/nth chunk...

BUG=skia:

Change-Id: Id3f0b900b1931f713f80a664f2b4b142f264be8d
Reviewed-on: https://skia-review.googlesource.com/9522
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
src/core/SkClipStack.cpp
src/core/SkClipStack.h