Clean up GraphicsContext use in RenderLayer::paintLayerContents()
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Apr 2016 02:55:01 +0000 (02:55 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Apr 2016 02:55:01 +0000 (02:55 +0000)
commit8ad0d1aa490e099e9474300635aa75f8a84154c3
tree2427c74182fde2ce9c8b209809e3b8a50bceb285
parentb1c2ee5ca0e5388b1243bc8415f5efa14ec60335
Clean up GraphicsContext use in RenderLayer::paintLayerContents()
https://bugs.webkit.org/show_bug.cgi?id=157193

Reviewed by Zalan Bujtas.

Make the lifetime of the temporary GraphicsContext used to paint filters more explicit
by putting it in an inner scope.

Make currentContext a reference.

transparencyLayerContext was a confusing name (it doens't mean we've started a
transparency layer), so just use "context" to refer to the original context. When
passed to other functions, this is called "contextForTransparencyLayer".

No longer leaves "context" as a null pointer if filterPainter->filterContext() returns
a null pointer. It's unclear if this ever happened.

* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRendererHelper::filterContext):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::applyFilters):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderLayer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h