aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkClipStack.cpp5
-rw-r--r--src/core/SkClipStack.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index f41945e090..d94bdcbf62 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -495,12 +495,13 @@ void SkClipStack::Element::updateBoundAndGenID(const Element* prior) {
static const int kDefaultElementAllocCnt = 8;
SkClipStack::SkClipStack()
- : fDeque(sizeof(Element), kDefaultElementAllocCnt)
+ : fDeque(sizeof(Element), fStorage, sizeof(fStorage), kDefaultElementAllocCnt)
, fSaveCount(0) {
}
SkClipStack::SkClipStack(const SkClipStack& b)
- : fDeque(sizeof(Element), kDefaultElementAllocCnt) {
+ : fDeque(sizeof(Element), fStorage, sizeof(fStorage), kDefaultElementAllocCnt)
+{
*this = b;
}
diff --git a/src/core/SkClipStack.h b/src/core/SkClipStack.h
index 080712dfe3..fac739eb2c 100644
--- a/src/core/SkClipStack.h
+++ b/src/core/SkClipStack.h
@@ -522,6 +522,10 @@ public:
private:
friend class Iter;
+ enum {
+ kPreallocCount = 16
+ };
+ intptr_t fStorage[kPreallocCount * sizeof(Element) / sizeof(intptr_t)];
SkDeque fDeque;
int fSaveCount;