<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[167553] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/167553">167553</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-04-19 15:26:59 -0700 (Sat, 19 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCAFiltersh">trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreePropertyAppliermm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/ChangeLog        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2014-04-19 Simon Fraser <simon.fraser@apple.com>
+
+ [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*.
+
+ 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.
+
</ins><span class="cx"> 2014-04-19 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix AVPlayerController leak on pages with video
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -736,6 +736,7 @@
</span><span class="cx"> __ZN7WebCore17MouseRelatedEvent7offsetYEv
</span><span class="cx"> __ZN7WebCore17PlatformCAFilters17setFiltersOnLayerEP7CALayerRKNS_16FilterOperationsE
</span><span class="cx"> __ZN7WebCore17PlatformCAFilters23filterValueForOperationEPKNS_15FilterOperationEi
</span><ins>+__ZN7WebCore17PlatformCAFilters25setBlendingFiltersOnLayerEP7CALayerNS_9BlendModeE
</ins><span class="cx"> __ZN7WebCore17SQLiteTransaction5beginEv
</span><span class="cx"> __ZN7WebCore17SQLiteTransaction6commitEv
</span><span class="cx"> __ZN7WebCore17SQLiteTransaction8rollbackEv
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -424,39 +424,39 @@
</span><span class="cx">
</span><span class="cx"> enum LayerChange {
</span><span class="cx"> NoChange = 0,
</span><del>- NameChanged = 1 << 1,
- ChildrenChanged = 1 << 2, // also used for content layer, and preserves-3d, and size if tiling changes?
- GeometryChanged = 1 << 3,
- TransformChanged = 1 << 4,
- ChildrenTransformChanged = 1 << 5,
- Preserves3DChanged = 1 << 6,
- MasksToBoundsChanged = 1 << 7,
- DrawsContentChanged = 1 << 8,
- BackgroundColorChanged = 1 << 9,
- ContentsOpaqueChanged = 1 << 10,
- BackfaceVisibilityChanged = 1 << 11,
- OpacityChanged = 1 << 12,
- AnimationChanged = 1 << 13,
- DirtyRectsChanged = 1 << 14,
- ContentsImageChanged = 1 << 15,
- ContentsMediaLayerChanged = 1 << 16,
- ContentsCanvasLayerChanged = 1 << 17,
- ContentsColorLayerChanged = 1 << 18,
- ContentsRectsChanged = 1 << 19,
- MaskLayerChanged = 1 << 20,
- ReplicatedLayerChanged = 1 << 21,
- ContentsNeedsDisplay = 1 << 22,
- AcceleratesDrawingChanged = 1 << 23,
- ContentsScaleChanged = 1 << 24,
- ContentsVisibilityChanged = 1 << 25,
- VisibleRectChanged = 1 << 26,
- FiltersChanged = 1 << 27,
- TilingAreaChanged = 1 << 28,
- TilesAdded = 1 < 29,
- DebugIndicatorsChanged = 1 << 30,
- CustomAppearanceChanged = 1 << 31,
- CustomBehaviorChanged = 1 << 32,
- BlendModeChanged = 1 << 33
</del><ins>+ NameChanged = 1LLU << 1,
+ ChildrenChanged = 1LLU << 2, // also used for content layer, and preserves-3d, and size if tiling changes?
+ GeometryChanged = 1LLU << 3,
+ TransformChanged = 1LLU << 4,
+ ChildrenTransformChanged = 1LLU << 5,
+ Preserves3DChanged = 1LLU << 6,
+ MasksToBoundsChanged = 1LLU << 7,
+ DrawsContentChanged = 1LLU << 8,
+ BackgroundColorChanged = 1LLU << 9,
+ ContentsOpaqueChanged = 1LLU << 10,
+ BackfaceVisibilityChanged = 1LLU << 11,
+ OpacityChanged = 1LLU << 12,
+ AnimationChanged = 1LLU << 13,
+ DirtyRectsChanged = 1LLU << 14,
+ ContentsImageChanged = 1LLU << 15,
+ ContentsMediaLayerChanged = 1LLU << 16,
+ ContentsCanvasLayerChanged = 1LLU << 17,
+ ContentsColorLayerChanged = 1LLU << 18,
+ ContentsRectsChanged = 1LLU << 19,
+ MaskLayerChanged = 1LLU << 20,
+ ReplicatedLayerChanged = 1LLU << 21,
+ ContentsNeedsDisplay = 1LLU << 22,
+ AcceleratesDrawingChanged = 1LLU << 23,
+ ContentsScaleChanged = 1LLU << 24,
+ ContentsVisibilityChanged = 1LLU << 25,
+ VisibleRectChanged = 1LLU << 26,
+ FiltersChanged = 1LLU << 27,
+ TilingAreaChanged = 1LLU << 28,
+ TilesAdded = 1LLU < 29,
+ DebugIndicatorsChanged = 1LLU << 30,
+ CustomAppearanceChanged = 1LLU << 31,
+ CustomBehaviorChanged = 1LLU << 32,
+ BlendModeChanged = 1LLU << 33
</ins><span class="cx"> };
</span><span class="cx"> typedef uint64_t LayerChangeFlags;
</span><span class="cx"> enum ScheduleFlushOrNot { ScheduleFlush, DontScheduleFlush };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCAFiltersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> class PlatformCAFilters {
</span><span class="cx"> public:
</span><span class="cx"> static void setFiltersOnLayer(PlatformLayer*, const FilterOperations&);
</span><del>- static void setBlendingFiltersOnLayer(PlatformCALayer*, const BlendMode);
</del><ins>+ static void setBlendingFiltersOnLayer(PlatformLayer*, const BlendMode);
</ins><span class="cx"> static int numAnimatedFilterProperties(FilterOperation::OperationType);
</span><span class="cx"> static const char* animatedFilterPropertyName(FilterOperation::OperationType, int internalFilterPropertyIndex);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><del>- void setBlendMode(BlendMode);
</del><ins>+ virtual void setBlendMode(BlendMode) = 0;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual void setName(const String&) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx">
</span><span class="cx"> #import "PlatformCAFilters.h"
</span><del>-
</del><span class="cx"> #import "BlockExceptions.h"
</span><span class="cx"> #import "FloatConversion.h"
</span><span class="cx"> #import "LengthFunctions.h" // This is a layering violation.
</span><span class="lines">@@ -39,13 +38,13 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="cx"> // FIXME: Should share these values with FilterEffectRenderer::build() (https://bugs.webkit.org/show_bug.cgi?id=76008).
</span><del>-static double sepiaFullConstants[3][3] = {
</del><ins>+static const double sepiaFullConstants[3][3] = {
</ins><span class="cx"> { 0.393, 0.769, 0.189 },
</span><span class="cx"> { 0.349, 0.686, 0.168 },
</span><span class="cx"> { 0.272, 0.534, 0.131 }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-static double sepiaNoneConstants[3][3] = {
</del><ins>+static const double sepiaNoneConstants[3][3] = {
</ins><span class="cx"> { 1, 0, 0 },
</span><span class="cx"> { 0, 1, 0 },
</span><span class="cx"> { 0, 0, 1 }
</span><span class="lines">@@ -538,11 +537,9 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformCALayer* platformCALayer, const BlendMode blendMode)
</del><ins>+void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformLayer* layer, const BlendMode blendMode)
</ins><span class="cx"> {
</span><span class="cx"> #if USE_CA_FILTERS
</span><del>- CALayer* layer = platformCALayer->platformLayer();
-
</del><span class="cx"> BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx">
</span><span class="cx"> CAFilter* filter = nil;
</span><span class="lines">@@ -595,9 +592,8 @@
</span><span class="cx"> [layer setCompositingFilter:filter];
</span><span class="cx">
</span><span class="cx"> END_BLOCK_OBJC_EXCEPTIONS
</span><del>-
</del><span class="cx"> #else
</span><del>- UNUSED_PARAM(platformCALayer);
</del><ins>+ UNUSED_PARAM(layer);
</ins><span class="cx"> UNUSED_PARAM(blendMode);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -122,6 +122,10 @@
</span><span class="cx"> virtual void copyFiltersFrom(const PlatformCALayer*) override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_COMPOSITING)
+ virtual void setBlendMode(BlendMode) override;
+#endif
+
</ins><span class="cx"> virtual void setName(const String&) override;
</span><span class="cx">
</span><span class="cx"> virtual void setSpeed(float) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -643,7 +643,7 @@
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx"> void PlatformCALayerMac::setFilters(const FilterOperations& filters)
</span><span class="cx"> {
</span><del>- PlatformCAFilters::setFiltersOnLayer(this->platformLayer(), filters);
</del><ins>+ PlatformCAFilters::setFiltersOnLayer(platformLayer(), filters);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PlatformCALayerMac::copyFiltersFrom(const PlatformCALayer* sourceLayer)
</span><span class="lines">@@ -679,9 +679,9 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><del>-void PlatformCALayer::setBlendMode(BlendMode blendMode)
</del><ins>+void PlatformCALayerMac::setBlendMode(BlendMode blendMode)
</ins><span class="cx"> {
</span><del>- PlatformCAFilters::setBlendingFiltersOnLayer(this, blendMode);
</del><ins>+ PlatformCAFilters::setBlendingFiltersOnLayer(platformLayer(), blendMode);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-04-19 Simon Fraser <simon.fraser@apple.com>
+
+ [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*.
+
+ 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:
+
</ins><span class="cx"> 2014-04-19 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix leak of UIScreenEdgePanGestureRecognizer in WKSwipeTransitionController
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreePropertyAppliermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -178,6 +178,9 @@
</span><span class="cx"> if (properties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged)
</span><span class="cx"> layer.magnificationFilter = toCAFilterType(properties.magnificationFilter);
</span><span class="cx">
</span><ins>+ if (properties.changedProperties & RemoteLayerTreeTransaction::BlendModeChanged)
+ PlatformCAFilters::setBlendingFiltersOnLayer(layer, properties.blendMode);
+
</ins><span class="cx"> if (properties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged)
</span><span class="cx"> layer.speed = properties.speed;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -72,14 +72,15 @@
</span><span class="cx"> ContentsScaleChanged = 1 << 19,
</span><span class="cx"> MinificationFilterChanged = 1 << 20,
</span><span class="cx"> MagnificationFilterChanged = 1 << 21,
</span><del>- SpeedChanged = 1 << 22,
- TimeOffsetChanged = 1 << 23,
- BackingStoreChanged = 1 << 24,
- FiltersChanged = 1 << 25,
- AnimationsChanged = 1 << 26,
- EdgeAntialiasingMaskChanged = 1 << 27,
- CustomAppearanceChanged = 1 << 28,
- CustomBehaviorChanged = 1 << 29
</del><ins>+ BlendModeChanged = 1 << 22,
+ SpeedChanged = 1 << 23,
+ TimeOffsetChanged = 1 << 24,
+ BackingStoreChanged = 1 << 25,
+ FiltersChanged = 1 << 26,
+ AnimationsChanged = 1 << 27,
+ EdgeAntialiasingMaskChanged = 1 << 28,
+ CustomAppearanceChanged = 1 << 29,
+ CustomBehaviorChanged = 1 << 30
</ins><span class="cx"> };
</span><span class="cx"> typedef unsigned LayerChange;
</span><span class="cx">
</span><span class="lines">@@ -143,6 +144,7 @@
</span><span class="cx"> WebCore::GraphicsLayer::CustomBehavior customBehavior;
</span><span class="cx"> WebCore::PlatformCALayer::FilterType minificationFilter;
</span><span class="cx"> WebCore::PlatformCALayer::FilterType magnificationFilter;
</span><ins>+ WebCore::BlendMode blendMode;
</ins><span class="cx"> bool hidden;
</span><span class="cx"> bool geometryFlipped;
</span><span class="cx"> bool doubleSided;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx"> , customBehavior(GraphicsLayer::NoCustomBehavior)
</span><span class="cx"> , minificationFilter(PlatformCALayer::FilterType::Linear)
</span><span class="cx"> , magnificationFilter(PlatformCALayer::FilterType::Linear)
</span><ins>+ , blendMode(BlendModeNormal)
</ins><span class="cx"> , hidden(false)
</span><span class="cx"> , geometryFlipped(false)
</span><span class="cx"> , doubleSided(true)
</span><span class="lines">@@ -125,6 +126,7 @@
</span><span class="cx"> , customBehavior(other.customBehavior)
</span><span class="cx"> , minificationFilter(other.minificationFilter)
</span><span class="cx"> , magnificationFilter(other.magnificationFilter)
</span><ins>+ , blendMode(other.blendMode)
</ins><span class="cx"> , hidden(other.hidden)
</span><span class="cx"> , geometryFlipped(other.geometryFlipped)
</span><span class="cx"> , doubleSided(other.doubleSided)
</span><span class="lines">@@ -216,6 +218,9 @@
</span><span class="cx"> if (changedProperties & MagnificationFilterChanged)
</span><span class="cx"> encoder.encodeEnum(magnificationFilter);
</span><span class="cx">
</span><ins>+ if (changedProperties & BlendModeChanged)
+ encoder.encodeEnum(blendMode);
+
</ins><span class="cx"> if (changedProperties & SpeedChanged)
</span><span class="cx"> encoder << speed;
</span><span class="cx">
</span><span class="lines">@@ -371,6 +376,11 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (result.changedProperties & BlendModeChanged) {
+ if (!decoder.decodeEnum(result.blendMode))
+ return false;
+ }
+
</ins><span class="cx"> if (result.changedProperties & SpeedChanged) {
</span><span class="cx"> if (!decoder.decode(result.speed))
</span><span class="cx"> return false;
</span><span class="lines">@@ -567,6 +577,7 @@
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(const FilterOperations&);
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::Properties&);
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(const RemoteLayerBackingStore&);
</span><ins>+ RemoteLayerTreeTextStream& operator<<(BlendMode);
</ins><span class="cx"> RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::AnimationType);
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::FillModeType);
</span><span class="cx"> RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::ValueFunctionType);
</span><span class="lines">@@ -714,7 +725,31 @@
</span><span class="cx"> }
</span><span class="cx"> return ts;
</span><span class="cx"> }
</span><del>-
</del><ins>+
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(BlendMode blendMode)
+{
+ RemoteLayerTreeTextStream& ts = *this;
+ switch (blendMode) {
+ case BlendModeNormal: ts << "normal"; break;
+ case BlendModeMultiply: ts << "multiply"; break;
+ case BlendModeScreen: ts << "screen"; break;
+ case BlendModeOverlay: ts << "overlay"; break;
+ case BlendModeDarken: ts << "darken"; break;
+ case BlendModeLighten: ts << "lighten"; break;
+ case BlendModeColorDodge: ts << "color-dodge"; break;
+ case BlendModeColorBurn: ts << "color-burn"; break;
+ case BlendModeHardLight: ts << "hard-light"; break;
+ case BlendModeSoftLight: ts << "soft-light"; break;
+ case BlendModeDifference: ts << "difference"; break;
+ case BlendModeExclusion: ts << "exclusion"; break;
+ case BlendModeHue: ts << "hue"; break;
+ case BlendModeSaturation: ts << "saturation"; break;
+ case BlendModeColor: ts << "color"; break;
+ case BlendModeLuminosity: ts << "luminosity"; break;
+ }
+ return ts;
+}
+
</ins><span class="cx"> RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::AnimationType type)
</span><span class="cx"> {
</span><span class="cx"> RemoteLayerTreeTextStream& ts = *this;
</span><span class="lines">@@ -1018,6 +1053,9 @@
</span><span class="cx"> if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged)
</span><span class="cx"> dumpProperty(ts, "magnificationFilter", layerProperties.magnificationFilter);
</span><span class="cx">
</span><ins>+ if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BlendModeChanged)
+ dumpProperty(ts, "blendMode", layerProperties.blendMode);
+
</ins><span class="cx"> if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged)
</span><span class="cx"> dumpProperty(ts, "speed", layerProperties.speed);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -528,6 +528,14 @@
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_COMPOSITING)
+void PlatformCALayerRemote::setBlendMode(BlendMode blendMode)
+{
+ m_properties.blendMode = blendMode;
+ m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BlendModeChanged);
+}
+#endif
+
</ins><span class="cx"> bool PlatformCALayerRemote::filtersCanBeComposited(const FilterOperations& filters)
</span><span class="cx"> {
</span><span class="cx"> return PlatformCALayerMac::filtersCanBeComposited(filters);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (167552 => 167553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-04-19 22:16:26 UTC (rev 167552)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-04-19 22:26:59 UTC (rev 167553)
</span><span class="lines">@@ -124,6 +124,10 @@
</span><span class="cx"> virtual void copyFiltersFrom(const WebCore::PlatformCALayer*) override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_COMPOSITING)
+ virtual void setBlendMode(WebCore::BlendMode) override;
+#endif
+
</ins><span class="cx"> virtual void setName(const String&) override;
</span><span class="cx">
</span><span class="cx"> virtual void setSpeed(float) override;
</span></span></pre>
</div>
</div>
</body>
</html>