[UI-side compositing] Implement blend modes
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Apr 2014 22:26:59 +0000 (22:26 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Apr 2014 22:26:59 +0000 (22:26 +0000)
commit51ff8e85080a7963059872e75418e621c1b5bf7c
treee8e65f0d9d22f43b33cda906a6dd12ebed0d2f20
parentf4b815b18a272d4d960096f739c97f1ea2e84561
[UI-side compositing] Implement blend modes
https://bugs.webkit.org/show_bug.cgi?id=131891
<rdar://problem/16490085>

Reviewed by Tim Horton.

Implement blend modes with UI-side compositing.

PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
PlatformCALayerMac and PlatformCALayerRemote.
PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
layer, so it can be called from the UI process on a CALayer*.

Source/WebCore:
Fix an issue with GraphicsLayerCA::LayerChange flags. 1 << 31 shifts
a signed integer, so it ended up setting all the high bits in m_uncommittedChanges,
causing us to push blend modes to the UI process for every layer. Fix by shifting
an unsigned long long (1LLU << 31). This should also fix a build warning on Windows.

* WebCore.exp.in:
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCAFilters.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::setFilters):
(PlatformCALayerMac::setBlendMode):
(PlatformCALayer::setBlendMode): Deleted.

Source/WebKit2:
Add BlendMode to LayerProperties, and initialize, encode and decode it,
as well as adding dumping support for blend modes.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setBlendMode):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/PlatformCAFilters.h
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h