Add a CGContextStateSaver and use it
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Oct 2015 22:36:03 +0000 (22:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Oct 2015 22:36:03 +0000 (22:36 +0000)
commit3222a99dc9d669f06048ce0f30b38413499f1bc0
tree793a785360f96dd0690ec27d2549254add52abf7
parentb46fc6bcb8f3220ca172a6a301d8ab64d828e273
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
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.h