Add a CGContextStateSaver and use it
https://bugs.webkit.org/show_bug.cgi?id=150049
Reviewed by Tim Horton.
Add a stack-based graphics state save/restore class for CGContext,
like the one we have for GraphicsContext, and use it in GraphicsContextCG.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawJoinedLines):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::strokeRect):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::CGContextStateSaver::CGContextStateSaver):
(WebCore::CGContextStateSaver::~CGContextStateSaver):
(WebCore::CGContextStateSaver::save):
(WebCore::CGContextStateSaver::restore):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190894
268f45cc-cd09-0410-ab3c-
d52691b4dbfc