diff options
Diffstat (limited to 'Source/WebCore/html/canvas/CanvasRenderingContext2D.h')
-rw-r--r-- | Source/WebCore/html/canvas/CanvasRenderingContext2D.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.h b/Source/WebCore/html/canvas/CanvasRenderingContext2D.h index a334873dc..783e95d31 100644 --- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.h +++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.h @@ -318,7 +318,7 @@ private: CanvasDidDrawApplyAll = 0xffffffff }; - State& modifiableState() { ASSERT(!m_unrealizedSaveCount); return m_stateStack.last(); } + State& modifiableState() { ASSERT(!m_unrealizedSaveCount || m_stateStack.size() >= MaxSaveCount); return m_stateStack.last(); } const State& state() const { return m_stateStack.last(); } void applyLineDash() const; @@ -334,11 +334,7 @@ private: GraphicsContext* drawingContext() const; void unwindStateStack(); - void realizeSaves() - { - if (m_unrealizedSaveCount) - realizeSavesLoop(); - } + void realizeSaves(); void realizeSavesLoop(); void applyStrokePattern(); @@ -394,6 +390,7 @@ private: virtual PlatformLayer* platformLayer() const override; #endif + static const unsigned MaxSaveCount = 1024 * 16; Vector<State, 1> m_stateStack; unsigned m_unrealizedSaveCount { 0 }; bool m_usesCSSCompatibilityParseMode; |