Add an AlphaPremultiplication enum and use it consistently
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Dec 2017 20:35:46 +0000 (20:35 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Dec 2017 20:35:46 +0000 (20:35 +0000)
commit0da4f96710154031c5c3e004a6c440813e02781d
treec8c80e40f2c7f3bac055526c8575eb869742e70f
parent1698426acf05c1340a5aa36ce711e2dd095f0d7c
Add an AlphaPremultiplication enum and use it consistently
https://bugs.webkit.org/show_bug.cgi?id=180316

Reviewed by Zalan Bujtas.

ImageBuffer-related code sometimes used the 'Multiply' enum, and sometimes
a bool to represent alpha premultiplication. Make an enum class and use it
everywhere. Re-order and rename some parameters to clarify the meaning of this
argument.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::putImageData):
* platform/graphics/GraphicsTypes.cpp:
(WebCore::operator<<):
* platform/graphics/GraphicsTypes.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::genericConvertToLuminanceMask):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::blurShadowBuffer):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):
(WebCore::ImageBuffer::getUnmultipliedImageData const):
(WebCore::ImageBuffer::getPremultipliedImageData const):
(WebCore::ImageBuffer::putByteArray):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData const):
(WebCore::ImageBuffer::getPremultipliedImageData const):
(WebCore::ImageBuffer::putByteArray):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData const):
(WebCore::ImageBufferData::putData):
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::imageBufferResult):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData const):
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData const):
(WebCore::ImageBuffer::getPremultipliedImageData const):
(WebCore::ImageBuffer::putByteArray):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/platform/graphics/GraphicsTypes.cpp
Source/WebCore/platform/graphics/GraphicsTypes.h
Source/WebCore/platform/graphics/ImageBuffer.cpp
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h
Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp
Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.h
Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp