<!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>[185856] 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/185856">185856</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2015-06-22 18:51:05 -0700 (Mon, 22 Jun 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename PlatformCA*Mac to PlatformCA*Cocoa
https://bugs.webkit.org/show_bug.cgi?id=146224
<rdar://problem/21497182>
Reviewed by Simon Fraser.
Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
to the more accurate Cocoa suffix.
Source/WebCore:
* WebCore.xcodeproj/project.pbxproj:
* page/mac/ServicesOverlayController.mm:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
* platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
* platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
* platform/graphics/ca/mac/WebTiledBackingLayer.mm:
Source/WebKit2:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::filtersCanBeComposited):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::create):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepagemacServicesOverlayControllermm">trunk/Source/WebCore/page/mac/ServicesOverlayController.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCAAnimationh">trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustommm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteTiledBackingcpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/graphics/ca/cocoa/</li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaLayerFlushSchedulerMaccpp">trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoah">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCAFiltersCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoah">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaWebTiledBackingLayerh">trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaWebTiledBackingLayermm">trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacLayerFlushSchedulerMaccpp">trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMach">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm</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="#trunkSourceWebCoreplatformgraphicscamacWebTiledBackingLayerh">trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacWebTiledBackingLayermm">trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/ChangeLog        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-06-22 Dean Jackson <dino@apple.com>
+
+ Rename PlatformCA*Mac to PlatformCA*Cocoa
+ https://bugs.webkit.org/show_bug.cgi?id=146224
+ <rdar://problem/21497182>
+
+ Reviewed by Simon Fraser.
+
+ Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
+ to the more accurate Cocoa suffix.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/mac/ServicesOverlayController.mm:
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ * platform/graphics/ca/PlatformCAAnimation.h:
+ * platform/graphics/ca/PlatformCALayer.h:
+ * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
+ * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
+ * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
+ * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
+ * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
+ * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
+ * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
+ * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
+ * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
+
</ins><span class="cx"> 2015-06-22 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> [cssjit] Disable compiling scrollbar pseudoclass selectors
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -469,7 +469,7 @@
</span><span class="cx">                 0F099D0917B968A100FF84B9 /* WebCoreTypedArrayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F099D0717B968A100FF84B9 /* WebCoreTypedArrayController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F11A54F0F39233100C37884 /* RenderSelectionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F13163E16ED0CC80035CC04 /* PlatformCAFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                0F13164016ED0CDE0035CC04 /* PlatformCAFiltersMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */; };
</del><ins>+                0F13164016ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm */; };
</ins><span class="cx">                 0F15DA8A0F3AAEE70000CE47 /* AnimationControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */; };
</span><span class="cx">                 0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */; };
</span><span class="cx">                 0F1774811378B772009DA76A /* ScrollAnimatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */; };
</span><span class="lines">@@ -511,7 +511,7 @@
</span><span class="cx">                 0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */; };
</span><span class="cx">                 0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                0F5E200618E771FC003EC3E5 /* PlatformCAAnimationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                0F5E200618E771FC003EC3E5 /* PlatformCAAnimationCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */; };
</span><span class="cx">                 0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F6383DD18615B29003E5DB5 /* ThreadedScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */; };
</span><span class="lines">@@ -1124,7 +1124,7 @@
</span><span class="cx">                 2D5C9D0119C7B52E00B3C5C1 /* PageOverlayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5C9CFD19C7B52E00B3C5C1 /* PageOverlayController.cpp */; };
</span><span class="cx">                 2D5C9D0219C7B52E00B3C5C1 /* PageOverlayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */; };
</span><del>-                2D70BA1318074DDF0001908A /* PlatformCALayerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                2D70BA1318074DDF0001908A /* PlatformCALayerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D70BA1218074DDF0001908A /* PlatformCALayerCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2D70BA1518074F860001908A /* PlatformCALayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D70BA1418074F850001908A /* PlatformCALayer.cpp */; };
</span><span class="cx">                 2D76BB821945632400CFD29A /* RunLoopObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D76BB801945632400CFD29A /* RunLoopObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D76BB8419456F8100CFD29A /* RunLoopObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */; };
</span><span class="lines">@@ -1678,8 +1678,8 @@
</span><span class="cx">                 494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 494BD7930F55C8EE00747828 /* WebKitPoint.h */; };
</span><span class="cx">                 494BD79D0F55C94C00747828 /* JSWebKitPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494BD79B0F55C94C00747828 /* JSWebKitPoint.cpp */; };
</span><span class="cx">                 494BD79E0F55C94C00747828 /* JSWebKitPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 494BD79C0F55C94C00747828 /* JSWebKitPoint.h */; };
</span><del>-                4958782112A57DDF007238AC /* PlatformCAAnimationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4958781F12A57DDF007238AC /* PlatformCAAnimationMac.mm */; };
-                4958782212A57DDF007238AC /* PlatformCALayerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4958782012A57DDF007238AC /* PlatformCALayerMac.mm */; };
</del><ins>+                4958782112A57DDF007238AC /* PlatformCAAnimationCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4958781F12A57DDF007238AC /* PlatformCAAnimationCocoa.mm */; };
+                4958782212A57DDF007238AC /* PlatformCALayerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4958782012A57DDF007238AC /* PlatformCALayerCocoa.mm */; };
</ins><span class="cx">                 4969B0F213D0B33F00DF3521 /* HitTestingTransformState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4969B0F013D0B33F00DF3521 /* HitTestingTransformState.cpp */; };
</span><span class="cx">                 4969B0F313D0B33F00DF3521 /* HitTestingTransformState.h in Headers */ = {isa = PBXBuildFile; fileRef = 4969B0F113D0B33F00DF3521 /* HitTestingTransformState.h */; };
</span><span class="cx">                 4983913F0F1E767500C23782 /* JSWebKitCSSMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4983913D0F1E767500C23782 /* JSWebKitCSSMatrix.cpp */; };
</span><span class="lines">@@ -7561,7 +7561,7 @@
</span><span class="cx">                 0F099D0717B968A100FF84B9 /* WebCoreTypedArrayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTypedArrayController.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSelectionInfo.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAFilters.h; sourceTree = "<group>"; };
</span><del>-                0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCAFiltersMac.mm; sourceTree = "<group>"; };
</del><ins>+                0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCAFiltersCocoa.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationControllerPrivate.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimatorIOS.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollAnimatorIOS.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -7604,7 +7604,7 @@
</span><span class="cx">                 0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationUtilities.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderEmbeddedObject.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderEmbeddedObject.h; sourceTree = "<group>"; };
</span><del>-                0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationMac.h; sourceTree = "<group>"; };
</del><ins>+                0F5E200518E771FC003EC3E5 /* PlatformCAAnimationCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationCocoa.h; sourceTree = "<group>"; };
</ins><span class="cx">                 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingConstraints.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingConstraints.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadedScrollingTree.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8283,7 +8283,7 @@
</span><span class="cx">                 2D5C9CFD19C7B52E00B3C5C1 /* PageOverlayController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageOverlayController.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageOverlayController.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PDFDocumentImageMac.mm; sourceTree = "<group>"; };
</span><del>-                2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCALayerMac.h; sourceTree = "<group>"; };
</del><ins>+                2D70BA1218074DDF0001908A /* PlatformCALayerCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCALayerCocoa.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2D70BA1418074F850001908A /* PlatformCALayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformCALayer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D76BB801945632400CFD29A /* RunLoopObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoopObserver.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoopObserver.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8880,8 +8880,8 @@
</span><span class="cx">                 494BD7940F55C8EE00747828 /* WebKitPoint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPoint.idl; sourceTree = "<group>"; };
</span><span class="cx">                 494BD79B0F55C94C00747828 /* JSWebKitPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPoint.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 494BD79C0F55C94C00747828 /* JSWebKitPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPoint.h; sourceTree = "<group>"; };
</span><del>-                4958781F12A57DDF007238AC /* PlatformCAAnimationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCAAnimationMac.mm; sourceTree = "<group>"; };
-                4958782012A57DDF007238AC /* PlatformCALayerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCALayerMac.mm; sourceTree = "<group>"; };
</del><ins>+                4958781F12A57DDF007238AC /* PlatformCAAnimationCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCAAnimationCocoa.mm; sourceTree = "<group>"; };
+                4958782012A57DDF007238AC /* PlatformCALayerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCALayerCocoa.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 4969B0F013D0B33F00DF3521 /* HitTestingTransformState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestingTransformState.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 4969B0F113D0B33F00DF3521 /* HitTestingTransformState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestingTransformState.h; sourceTree = "<group>"; };
</span><span class="cx">                 4983913D0F1E767500C23782 /* JSWebKitCSSMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrix.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -16266,19 +16266,19 @@
</span><span class="cx">                         path = canvas;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><del>-                4958781E12A57DBC007238AC /* mac */ = {
</del><ins>+                4958781E12A57DBC007238AC /* cocoa */ = {
</ins><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */,
</span><del>-                                0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */,
-                                4958781F12A57DDF007238AC /* PlatformCAAnimationMac.mm */,
-                                0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */,
-                                2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */,
-                                4958782012A57DDF007238AC /* PlatformCALayerMac.mm */,
</del><ins>+                                0F5E200518E771FC003EC3E5 /* PlatformCAAnimationCocoa.h */,
+                                4958781F12A57DDF007238AC /* PlatformCAAnimationCocoa.mm */,
+                                0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm */,
+                                2D70BA1218074DDF0001908A /* PlatformCALayerCocoa.h */,
+                                4958782012A57DDF007238AC /* PlatformCALayerCocoa.mm */,
</ins><span class="cx">                                 0F580FA11496939100FB5BD8 /* WebTiledBackingLayer.h */,
</span><span class="cx">                                 0F580FA21496939100FB5BD8 /* WebTiledBackingLayer.mm */,
</span><span class="cx">                         );
</span><del>-                        path = mac;
</del><ins>+                        path = cocoa;
</ins><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><span class="cx">                 498770C11242C50D002226BA /* gpu */ = {
</span><span class="lines">@@ -16295,7 +16295,7 @@
</span><span class="cx">                 499B3EC0128CCC1800E726C2 /* ca */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                4958781E12A57DBC007238AC /* mac */,
</del><ins>+                                4958781E12A57DBC007238AC /* cocoa */,
</ins><span class="cx">                                 499B3ED4128CD31400E726C2 /* GraphicsLayerCA.cpp */,
</span><span class="cx">                                 499B3ED5128CD31400E726C2 /* GraphicsLayerCA.h */,
</span><span class="cx">                                 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */,
</span><span class="lines">@@ -26101,11 +26101,11 @@
</span><span class="cx">                                 49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */,
</span><span class="cx">                                 D0FF2A5E11F8C45A007E74E0 /* PingLoader.h in Headers */,
</span><span class="cx">                                 499B3EDD128DB50200E726C2 /* PlatformCAAnimation.h in Headers */,
</span><del>-                                0F5E200618E771FC003EC3E5 /* PlatformCAAnimationMac.h in Headers */,
</del><ins>+                                0F5E200618E771FC003EC3E5 /* PlatformCAAnimationCocoa.h in Headers */,
</ins><span class="cx">                                 0F13163E16ED0CC80035CC04 /* PlatformCAFilters.h in Headers */,
</span><span class="cx">                                 499B3EC5128CCC4700E726C2 /* PlatformCALayer.h in Headers */,
</span><span class="cx">                                 493E5E0912D6420500020081 /* PlatformCALayerClient.h in Headers */,
</span><del>-                                2D70BA1318074DDF0001908A /* PlatformCALayerMac.h in Headers */,
</del><ins>+                                2D70BA1318074DDF0001908A /* PlatformCALayerCocoa.h in Headers */,
</ins><span class="cx">                                 A14978711ABAF3A500CEF7E4 /* PlatformContentFilter.h in Headers */,
</span><span class="cx">                                 E1424C8A164B3B4E00F32D40 /* PlatformCookieJar.h in Headers */,
</span><span class="cx">                                 BC5C762B1497FE1400BC4775 /* PlatformEvent.h in Headers */,
</span><span class="lines">@@ -29648,10 +29648,10 @@
</span><span class="cx">                                 FD581FB41520F93B003A7A75 /* PeriodicWave.cpp in Sources */,
</span><span class="cx">                                 49D5DC2D0F423A73008F20FD /* PerspectiveTransformOperation.cpp in Sources */,
</span><span class="cx">                                 D0FF2A5D11F8C45A007E74E0 /* PingLoader.cpp in Sources */,
</span><del>-                                4958782112A57DDF007238AC /* PlatformCAAnimationMac.mm in Sources */,
-                                0F13164016ED0CDE0035CC04 /* PlatformCAFiltersMac.mm in Sources */,
</del><ins>+                                4958782112A57DDF007238AC /* PlatformCAAnimationCocoa.mm in Sources */,
+                                0F13164016ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm in Sources */,
</ins><span class="cx">                                 2D70BA1518074F860001908A /* PlatformCALayer.cpp in Sources */,
</span><del>-                                4958782212A57DDF007238AC /* PlatformCALayerMac.mm in Sources */,
</del><ins>+                                4958782212A57DDF007238AC /* PlatformCALayerCocoa.mm in Sources */,
</ins><span class="cx">                                 CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */,
</span><span class="cx">                                 CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */,
</span><span class="cx">                                 26601EC014B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacServicesOverlayControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/ServicesOverlayController.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/ServicesOverlayController.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/page/mac/ServicesOverlayController.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> #import "MainFrame.h"
</span><span class="cx"> #import "Page.h"
</span><span class="cx"> #import "PageOverlayController.h"
</span><del>-#import "PlatformCAAnimationMac.h"
</del><ins>+#import "PlatformCAAnimationCocoa.h"
</ins><span class="cx"> #import "Settings.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx"> [animation setRemovedOnCompletion:false];
</span><span class="cx"> [animation setToValue:@1];
</span><span class="cx">
</span><del>- RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationMac::create(animation.get());
</del><ins>+ RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationCocoa::create(animation.get());
</ins><span class="cx"> downcast<GraphicsLayerCA>(*layer()).platformCALayer()->addAnimationForKey("FadeHighlightIn", *platformAnimation);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> retainedSelf->didFinishFadeOutAnimation();
</span><span class="cx"> }];
</span><span class="cx">
</span><del>- RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationMac::create(animation.get());
</del><ins>+ RefPtr<PlatformCAAnimation> platformAnimation = PlatformCAAnimationCocoa::create(animation.get());
</ins><span class="cx"> downcast<GraphicsLayerCA>(*layer()).platformCALayer()->addAnimationForKey("FadeHighlightOut", *platformAnimation);
</span><span class="cx"> [CATransaction commit];
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -53,8 +53,8 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-#include "PlatformCAAnimationMac.h"
-#include "PlatformCALayerMac.h"
</del><ins>+#include "PlatformCAAnimationCocoa.h"
+#include "PlatformCALayerCocoa.h"
</ins><span class="cx"> #include "WebCoreSystemInterface.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -289,7 +289,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> case Type::Shape:
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- // FIXME: we can use shaper layers on Windows when PlatformCALayerMac::setShapePath() etc are implemented.
</del><ins>+ // FIXME: we can use shaper layers on Windows when PlatformCALayerCocoa::setShapePath() etc are implemented.
</ins><span class="cx"> return true;
</span><span class="cx"> #else
</span><span class="cx"> return false;
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx"> bool GraphicsLayerCA::filtersCanBeComposited(const FilterOperations& filters)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- return PlatformCALayerMac::filtersCanBeComposited(filters);
</del><ins>+ return PlatformCALayerCocoa::filtersCanBeComposited(filters);
</ins><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> return PlatformCALayerWin::filtersCanBeComposited(filters);
</span><span class="cx"> #endif
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx"> PassRefPtr<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* owner)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- return PlatformCALayerMac::create(layerType, owner);
</del><ins>+ return PlatformCALayerCocoa::create(layerType, owner);
</ins><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> return PlatformCALayerWin::create(layerType, owner);
</span><span class="cx"> #endif
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx"> PassRefPtr<PlatformCALayer> GraphicsLayerCA::createPlatformCALayer(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- return PlatformCALayerMac::create(platformLayer, owner);
</del><ins>+ return PlatformCALayerCocoa::create(platformLayer, owner);
</ins><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> return PlatformCALayerWin::create(platformLayer, owner);
</span><span class="cx"> #endif
</span><span class="lines">@@ -347,7 +347,7 @@
</span><span class="cx"> PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- return PlatformCAAnimationMac::create(type, keyPath);
</del><ins>+ return PlatformCAAnimationCocoa::create(type, keyPath);
</ins><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> return PlatformCAAnimationWin::create(type, keyPath);
</span><span class="cx"> #endif
</span><span class="lines">@@ -1219,7 +1219,7 @@
</span><span class="cx"> FloatPoint boundsOrigin = m_boundsOrigin;
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // In WK1, UIKit may be changing layer bounds behind our back in overflow-scroll layers, so use the layer's origin.
</span><del>- if (m_layer->isPlatformCALayerMac())
</del><ins>+ if (m_layer->isPlatformCALayerCocoa())
</ins><span class="cx"> boundsOrigin = m_layer->bounds().location();
</span><span class="cx"> #endif
</span><span class="cx"> clipRectForChildren.move(boundsOrigin.x(), boundsOrigin.y());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCAAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">
</span><span class="cx"> virtual ~PlatformCAAnimation() { }
</span><span class="cx">
</span><del>- virtual bool isPlatformCAAnimationMac() const { return false; }
</del><ins>+ virtual bool isPlatformCAAnimationCocoa() const { return false; }
</ins><span class="cx"> virtual bool isPlatformCAAnimationWin() const { return false; }
</span><span class="cx"> virtual bool isPlatformCAAnimationRemote() const { return false; }
</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 (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">
</span><span class="cx"> class WEBCORE_EXPORT PlatformCALayer : public RefCounted<PlatformCALayer> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- friend class PlatformCALayerMac;
</del><ins>+ friend class PlatformCALayerCocoa;
</ins><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> friend class PlatformCALayerWin;
</span><span class="cx"> #endif
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">
</span><span class="cx"> GraphicsLayer::PlatformLayerID layerID() const { return m_layerID; }
</span><span class="cx">
</span><del>- virtual bool isPlatformCALayerMac() const { return false; }
</del><ins>+ virtual bool isPlatformCALayerCocoa() const { return false; }
</ins><span class="cx"> virtual bool isPlatformCALayerRemote() const { return false; }
</span><span class="cx"> virtual bool isPlatformCALayerRemoteCustom() const { return false; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaLayerFlushSchedulerMaccppfromrev185855trunkSourceWebCoreplatformgraphicscamacLayerFlushSchedulerMaccpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "LayerFlushScheduler.h"
+
+#include <wtf/AutodrainedPool.h>
+
+#if PLATFORM(IOS)
+#include "RuntimeApplicationChecksIOS.h"
+#include <CoreFoundation/CFBundle.h>
+#include <WebCore/WebCoreThread.h>
+#endif
+
+namespace WebCore {
+
+static const CFIndex layerFlushRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
+
+static CFRunLoopRef currentRunLoop()
+{
+#if PLATFORM(IOS)
+ // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
+ // observer is added to the main run loop <rdar://problem/9798550>. However, for responsiveness,
+ // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
+ // crash are especially troublesome for iBooks, we never allow the observer to be added to the
+ // main run loop in iBooks.
+ if (applicationIsIBooksOnIOS())
+ return WebThreadRunLoop();
+#endif
+ return CFRunLoopGetCurrent();
+}
+
+LayerFlushScheduler::LayerFlushScheduler(LayerFlushSchedulerClient* client)
+ : m_isSuspended(false)
+ , m_client(client)
+{
+ ASSERT_ARG(client, client);
+
+ m_runLoopObserver = RunLoopObserver::create(layerFlushRunLoopOrder, [this]() {
+ if (this->isSuspended())
+ return;
+ this->layerFlushCallback();
+ });
+}
+
+LayerFlushScheduler::~LayerFlushScheduler()
+{
+}
+
+void LayerFlushScheduler::layerFlushCallback()
+{
+ ASSERT(!m_isSuspended);
+
+ AutodrainedPool pool;
+ if (m_client->flushLayers())
+ invalidate();
+}
+
+void LayerFlushScheduler::schedule()
+{
+ if (m_isSuspended)
+ return;
+
+ m_runLoopObserver->schedule(currentRunLoop());
+}
+
+void LayerFlushScheduler::invalidate()
+{
+ m_runLoopObserver->invalidate();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaLayerFlushSchedulerMaccpp"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoahfromrev185855trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMach"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,138 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformCAAnimationCocoa_h
+#define PlatformCAAnimationCocoa_h
+
+#include "PlatformCAAnimation.h"
+
+#include <wtf/RetainPtr.h>
+
+OBJC_CLASS CAMediaTimingFunction;
+OBJC_CLASS CAAnimation;
+OBJC_CLASS CAPropertyAnimation;
+OBJC_CLASS NSString;
+
+typedef CAPropertyAnimation* PlatformAnimationRef;
+
+namespace WebCore {
+
+WEBCORE_EXPORT NSString* toCAFillModeType(PlatformCAAnimation::FillModeType);
+WEBCORE_EXPORT NSString* toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType);
+WEBCORE_EXPORT CAMediaTimingFunction* toCAMediaTimingFunction(const TimingFunction*, bool reverse);
+
+bool hasExplicitBeginTime(CAAnimation *);
+void setHasExplicitBeginTime(CAAnimation *, bool);
+
+class PlatformCAAnimationCocoa final : public PlatformCAAnimation {
+public:
+ static PassRefPtr<PlatformCAAnimation> create(AnimationType, const String& keyPath);
+ WEBCORE_EXPORT static PassRefPtr<PlatformCAAnimation> create(PlatformAnimationRef);
+
+ virtual ~PlatformCAAnimationCocoa();
+
+ virtual bool isPlatformCAAnimationCocoa() const override { return true; }
+
+ virtual PassRefPtr<PlatformCAAnimation> copy() const override;
+
+ PlatformAnimationRef platformAnimation() const;
+
+ virtual String keyPath() const override;
+
+ virtual CFTimeInterval beginTime() const override;
+ virtual void setBeginTime(CFTimeInterval) override;
+
+ virtual CFTimeInterval duration() const override;
+ virtual void setDuration(CFTimeInterval) override;
+
+ virtual float speed() const override;
+ virtual void setSpeed(float) override;
+
+ virtual CFTimeInterval timeOffset() const override;
+ virtual void setTimeOffset(CFTimeInterval) override;
+
+ virtual float repeatCount() const override;
+ virtual void setRepeatCount(float) override;
+
+ virtual bool autoreverses() const override;
+ virtual void setAutoreverses(bool) override;
+
+ virtual FillModeType fillMode() const override;
+ virtual void setFillMode(FillModeType) override;
+
+ virtual void setTimingFunction(const TimingFunction*, bool reverse = false) override;
+ void copyTimingFunctionFrom(const PlatformCAAnimation&) override;
+
+ virtual bool isRemovedOnCompletion() const override;
+ virtual void setRemovedOnCompletion(bool) override;
+
+ virtual bool isAdditive() const override;
+ virtual void setAdditive(bool) override;
+
+ virtual ValueFunctionType valueFunction() const override;
+ virtual void setValueFunction(ValueFunctionType) override;
+
+ // Basic-animation properties.
+ virtual void setFromValue(float) override;
+ virtual void setFromValue(const WebCore::TransformationMatrix&) override;
+ virtual void setFromValue(const FloatPoint3D&) override;
+ virtual void setFromValue(const WebCore::Color&) override;
+ virtual void setFromValue(const FilterOperation*, int internalFilterPropertyIndex) override;
+ virtual void copyFromValueFrom(const PlatformCAAnimation&) override;
+
+ virtual void setToValue(float) override;
+ virtual void setToValue(const WebCore::TransformationMatrix&) override;
+ virtual void setToValue(const FloatPoint3D&) override;
+ virtual void setToValue(const WebCore::Color&) override;
+ virtual void setToValue(const FilterOperation*, int internalFilterPropertyIndex) override;
+ virtual void copyToValueFrom(const PlatformCAAnimation&) override;
+
+ // Keyframe-animation properties.
+ virtual void setValues(const Vector<float>&) override;
+ virtual void setValues(const Vector<WebCore::TransformationMatrix>&) override;
+ virtual void setValues(const Vector<FloatPoint3D>&) override;
+ virtual void setValues(const Vector<WebCore::Color>&) override;
+ virtual void setValues(const Vector<RefPtr<FilterOperation>>&, int internalFilterPropertyIndex) override;
+ virtual void copyValuesFrom(const PlatformCAAnimation&) override;
+
+ virtual void setKeyTimes(const Vector<float>&) override;
+ virtual void copyKeyTimesFrom(const PlatformCAAnimation&) override;
+
+ virtual void setTimingFunctions(const Vector<const TimingFunction*>&, bool reverse = false) override;
+ virtual void copyTimingFunctionsFrom(const PlatformCAAnimation&) override;
+
+protected:
+ PlatformCAAnimationCocoa(AnimationType, const String& keyPath);
+ PlatformCAAnimationCocoa(PlatformAnimationRef);
+
+private:
+ RetainPtr<CAPropertyAnimation> m_animation;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CAANIMATION(WebCore::PlatformCAAnimationCocoa, isPlatformCAAnimationCocoa())
+
+#endif // PlatformCAAnimationCocoa_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoah"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoammfromrev185855trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,577 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#import "PlatformCAAnimationCocoa.h"
+
+#import "FloatConversion.h"
+#import "PlatformCAFilters.h"
+#import "TimingFunction.h"
+#import <QuartzCore/QuartzCore.h>
+#import <wtf/text/WTFString.h>
+
+using namespace WebCore;
+
+static NSString * const WKExplicitBeginTimeFlag = @"WKPlatformCAAnimationExplicitBeginTimeFlag";
+
+bool WebCore::hasExplicitBeginTime(CAAnimation *animation)
+{
+ return [[animation valueForKey:WKExplicitBeginTimeFlag] boolValue];
+}
+
+void WebCore::setHasExplicitBeginTime(CAAnimation *animation, bool value)
+{
+ [animation setValue:[NSNumber numberWithBool:value] forKey:WKExplicitBeginTimeFlag];
+}
+
+NSString* WebCore::toCAFillModeType(PlatformCAAnimation::FillModeType type)
+{
+ switch (type) {
+ case PlatformCAAnimation::NoFillMode:
+ case PlatformCAAnimation::Forwards: return kCAFillModeForwards;
+ case PlatformCAAnimation::Backwards: return kCAFillModeBackwards;
+ case PlatformCAAnimation::Both: return kCAFillModeBoth;
+ }
+ return @"";
+}
+
+static PlatformCAAnimation::FillModeType fromCAFillModeType(NSString* string)
+{
+ if ([string isEqualToString:kCAFillModeBackwards])
+ return PlatformCAAnimation::Backwards;
+
+ if ([string isEqualToString:kCAFillModeBoth])
+ return PlatformCAAnimation::Both;
+
+ return PlatformCAAnimation::Forwards;
+}
+
+NSString* WebCore::toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType type)
+{
+ switch (type) {
+ case PlatformCAAnimation::NoValueFunction: return @"";
+ case PlatformCAAnimation::RotateX: return kCAValueFunctionRotateX;
+ case PlatformCAAnimation::RotateY: return kCAValueFunctionRotateY;
+ case PlatformCAAnimation::RotateZ: return kCAValueFunctionRotateZ;
+ case PlatformCAAnimation::ScaleX: return kCAValueFunctionScaleX;
+ case PlatformCAAnimation::ScaleY: return kCAValueFunctionScaleY;
+ case PlatformCAAnimation::ScaleZ: return kCAValueFunctionScaleZ;
+ case PlatformCAAnimation::Scale: return kCAValueFunctionScale;
+ case PlatformCAAnimation::TranslateX: return kCAValueFunctionTranslateX;
+ case PlatformCAAnimation::TranslateY: return kCAValueFunctionTranslateY;
+ case PlatformCAAnimation::TranslateZ: return kCAValueFunctionTranslateZ;
+ case PlatformCAAnimation::Translate: return kCAValueFunctionTranslate;
+ }
+ return @"";
+}
+
+static PlatformCAAnimation::ValueFunctionType fromCAValueFunctionType(NSString* string)
+{
+ if ([string isEqualToString:kCAValueFunctionRotateX])
+ return PlatformCAAnimation::RotateX;
+
+ if ([string isEqualToString:kCAValueFunctionRotateY])
+ return PlatformCAAnimation::RotateY;
+
+ if ([string isEqualToString:kCAValueFunctionRotateZ])
+ return PlatformCAAnimation::RotateZ;
+
+ if ([string isEqualToString:kCAValueFunctionScaleX])
+ return PlatformCAAnimation::ScaleX;
+
+ if ([string isEqualToString:kCAValueFunctionScaleY])
+ return PlatformCAAnimation::ScaleY;
+
+ if ([string isEqualToString:kCAValueFunctionScaleZ])
+ return PlatformCAAnimation::ScaleZ;
+
+ if ([string isEqualToString:kCAValueFunctionScale])
+ return PlatformCAAnimation::Scale;
+
+ if ([string isEqualToString:kCAValueFunctionTranslateX])
+ return PlatformCAAnimation::TranslateX;
+
+ if ([string isEqualToString:kCAValueFunctionTranslateY])
+ return PlatformCAAnimation::TranslateY;
+
+ if ([string isEqualToString:kCAValueFunctionTranslateZ])
+ return PlatformCAAnimation::TranslateZ;
+
+ if ([string isEqualToString:kCAValueFunctionTranslate])
+ return PlatformCAAnimation::Translate;
+
+ return PlatformCAAnimation::NoValueFunction;
+}
+
+CAMediaTimingFunction* WebCore::toCAMediaTimingFunction(const TimingFunction* timingFunction, bool reverse)
+{
+ ASSERT(timingFunction);
+ if (timingFunction->isCubicBezierTimingFunction()) {
+ RefPtr<CubicBezierTimingFunction> reversed;
+ const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(timingFunction);
+
+ if (reverse) {
+ reversed = ctf->createReversed();
+ ctf = reversed.get();
+ }
+
+ float x1 = static_cast<float>(ctf->x1());
+ float y1 = static_cast<float>(ctf->y1());
+ float x2 = static_cast<float>(ctf->x2());
+ float y2 = static_cast<float>(ctf->y2());
+ return [CAMediaTimingFunction functionWithControlPoints: x1 : y1 : x2 : y2];
+ }
+
+ ASSERT(timingFunction->type() == TimingFunction::LinearFunction);
+ return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
+}
+
+PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::create(AnimationType type, const String& keyPath)
+{
+ return adoptRef(new PlatformCAAnimationCocoa(type, keyPath));
+}
+
+PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::create(PlatformAnimationRef animation)
+{
+ return adoptRef(new PlatformCAAnimationCocoa(animation));
+}
+
+PlatformCAAnimationCocoa::PlatformCAAnimationCocoa(AnimationType type, const String& keyPath)
+ : PlatformCAAnimation(type)
+{
+ if (type == Basic)
+ m_animation = [CABasicAnimation animationWithKeyPath:keyPath];
+ else
+ m_animation = [CAKeyframeAnimation animationWithKeyPath:keyPath];
+}
+
+PlatformCAAnimationCocoa::PlatformCAAnimationCocoa(PlatformAnimationRef animation)
+{
+ if ([static_cast<CAAnimation*>(animation) isKindOfClass:[CABasicAnimation class]])
+ setType(Basic);
+ else if ([static_cast<CAAnimation*>(animation) isKindOfClass:[CAKeyframeAnimation class]])
+ setType(Keyframe);
+ else {
+ ASSERT(0);
+ return;
+ }
+
+ m_animation = static_cast<CAPropertyAnimation*>(animation);
+}
+
+PlatformCAAnimationCocoa::~PlatformCAAnimationCocoa()
+{
+}
+
+PassRefPtr<PlatformCAAnimation> PlatformCAAnimationCocoa::copy() const
+{
+ RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath());
+
+ animation->setBeginTime(beginTime());
+ animation->setDuration(duration());
+ animation->setSpeed(speed());
+ animation->setTimeOffset(timeOffset());
+ animation->setRepeatCount(repeatCount());
+ animation->setAutoreverses(autoreverses());
+ animation->setFillMode(fillMode());
+ animation->setRemovedOnCompletion(isRemovedOnCompletion());
+ animation->setAdditive(isAdditive());
+ animation->copyTimingFunctionFrom(*this);
+ animation->setValueFunction(valueFunction());
+
+ setHasExplicitBeginTime(downcast<PlatformCAAnimationCocoa>(*animation).platformAnimation(), hasExplicitBeginTime(platformAnimation()));
+
+ // Copy the specific Basic or Keyframe values.
+ if (animationType() == Keyframe) {
+ animation->copyValuesFrom(*this);
+ animation->copyKeyTimesFrom(*this);
+ animation->copyTimingFunctionsFrom(*this);
+ } else {
+ animation->copyFromValueFrom(*this);
+ animation->copyToValueFrom(*this);
+ }
+
+ return animation;
+}
+
+PlatformAnimationRef PlatformCAAnimationCocoa::platformAnimation() const
+{
+ return m_animation.get();
+}
+
+String PlatformCAAnimationCocoa::keyPath() const
+{
+ return [m_animation keyPath];
+}
+
+CFTimeInterval PlatformCAAnimationCocoa::beginTime() const
+{
+ return [m_animation beginTime];
+}
+
+void PlatformCAAnimationCocoa::setBeginTime(CFTimeInterval value)
+{
+ [m_animation setBeginTime:value];
+
+ // Also set a flag to tell us if we've passed in a 0 value.
+ // The flag is needed because later beginTime will get changed
+ // to the time at which it fired and we need to know whether
+ // or not it was 0 to begin with.
+ if (value)
+ setHasExplicitBeginTime(m_animation.get(), true);
+}
+
+CFTimeInterval PlatformCAAnimationCocoa::duration() const
+{
+ return [m_animation duration];
+}
+
+void PlatformCAAnimationCocoa::setDuration(CFTimeInterval value)
+{
+ [m_animation setDuration:value];
+}
+
+float PlatformCAAnimationCocoa::speed() const
+{
+ return [m_animation speed];
+}
+
+void PlatformCAAnimationCocoa::setSpeed(float value)
+{
+ [m_animation setSpeed:value];
+}
+
+CFTimeInterval PlatformCAAnimationCocoa::timeOffset() const
+{
+ return [m_animation timeOffset];
+}
+
+void PlatformCAAnimationCocoa::setTimeOffset(CFTimeInterval value)
+{
+ [m_animation setTimeOffset:value];
+}
+
+float PlatformCAAnimationCocoa::repeatCount() const
+{
+ return [m_animation repeatCount];
+}
+
+void PlatformCAAnimationCocoa::setRepeatCount(float value)
+{
+ [m_animation setRepeatCount:value];
+}
+
+bool PlatformCAAnimationCocoa::autoreverses() const
+{
+ return [m_animation autoreverses];
+}
+
+void PlatformCAAnimationCocoa::setAutoreverses(bool value)
+{
+ [m_animation setAutoreverses:value];
+}
+
+PlatformCAAnimation::FillModeType PlatformCAAnimationCocoa::fillMode() const
+{
+ return fromCAFillModeType([m_animation fillMode]);
+}
+
+void PlatformCAAnimationCocoa::setFillMode(FillModeType value)
+{
+ [m_animation setFillMode:toCAFillModeType(value)];
+}
+
+void PlatformCAAnimationCocoa::setTimingFunction(const TimingFunction* value, bool reverse)
+{
+ [m_animation setTimingFunction:toCAMediaTimingFunction(value, reverse)];
+}
+
+void PlatformCAAnimationCocoa::copyTimingFunctionFrom(const PlatformCAAnimation& value)
+{
+ [m_animation setTimingFunction:[downcast<PlatformCAAnimationCocoa>(value).m_animation.get() timingFunction]];
+}
+
+bool PlatformCAAnimationCocoa::isRemovedOnCompletion() const
+{
+ return [m_animation isRemovedOnCompletion];
+}
+
+void PlatformCAAnimationCocoa::setRemovedOnCompletion(bool value)
+{
+ [m_animation setRemovedOnCompletion:value];
+}
+
+bool PlatformCAAnimationCocoa::isAdditive() const
+{
+ return [m_animation isAdditive];
+}
+
+void PlatformCAAnimationCocoa::setAdditive(bool value)
+{
+ [m_animation setAdditive:value];
+}
+
+PlatformCAAnimation::ValueFunctionType PlatformCAAnimationCocoa::valueFunction() const
+{
+ CAValueFunction* vf = [m_animation valueFunction];
+ return fromCAValueFunctionType([vf name]);
+}
+
+void PlatformCAAnimationCocoa::setValueFunction(ValueFunctionType value)
+{
+ [m_animation setValueFunction:[CAValueFunction functionWithName:toCAValueFunctionType(value)]];
+}
+
+void PlatformCAAnimationCocoa::setFromValue(float value)
+{
+ if (animationType() != Basic)
+ return;
+ [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[NSNumber numberWithDouble:value]];
+}
+
+void PlatformCAAnimationCocoa::setFromValue(const WebCore::TransformationMatrix& value)
+{
+ if (animationType() != Basic)
+ return;
+
+ [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[NSValue valueWithCATransform3D:value]];
+}
+
+void PlatformCAAnimationCocoa::setFromValue(const FloatPoint3D& value)
+{
+ if (animationType() != Basic)
+ return;
+
+ NSArray* array = [NSArray arrayWithObjects:
+ [NSNumber numberWithDouble:value.x()],
+ [NSNumber numberWithDouble:value.y()],
+ [NSNumber numberWithDouble:value.z()],
+ nil];
+ [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:array];
+}
+
+void PlatformCAAnimationCocoa::setFromValue(const WebCore::Color& value)
+{
+ if (animationType() != Basic)
+ return;
+
+ NSArray* array = [NSArray arrayWithObjects:
+ [NSNumber numberWithDouble:value.red()],
+ [NSNumber numberWithDouble:value.green()],
+ [NSNumber numberWithDouble:value.blue()],
+ [NSNumber numberWithDouble:value.alpha()],
+ nil];
+ [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:array];
+}
+
+void PlatformCAAnimationCocoa::setFromValue(const FilterOperation* operation, int internalFilterPropertyIndex)
+{
+ RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(operation, internalFilterPropertyIndex);
+ [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:value.get()];
+}
+
+void PlatformCAAnimationCocoa::copyFromValueFrom(const PlatformCAAnimation& value)
+{
+ if (animationType() != Basic || value.animationType() != Basic)
+ return;
+
+ CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>(downcast<PlatformCAAnimationCocoa>(value).m_animation.get());
+ [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[otherAnimation fromValue]];
+}
+
+void PlatformCAAnimationCocoa::setToValue(float value)
+{
+ if (animationType() != Basic)
+ return;
+ [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[NSNumber numberWithDouble:value]];
+}
+
+void PlatformCAAnimationCocoa::setToValue(const WebCore::TransformationMatrix& value)
+{
+ if (animationType() != Basic)
+ return;
+
+ [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[NSValue valueWithCATransform3D:value]];
+}
+
+void PlatformCAAnimationCocoa::setToValue(const FloatPoint3D& value)
+{
+ if (animationType() != Basic)
+ return;
+
+ NSArray* array = [NSArray arrayWithObjects:
+ [NSNumber numberWithDouble:value.x()],
+ [NSNumber numberWithDouble:value.y()],
+ [NSNumber numberWithDouble:value.z()],
+ nil];
+ [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:array];
+}
+
+void PlatformCAAnimationCocoa::setToValue(const WebCore::Color& value)
+{
+ if (animationType() != Basic)
+ return;
+
+ NSArray* array = [NSArray arrayWithObjects:
+ [NSNumber numberWithDouble:value.red()],
+ [NSNumber numberWithDouble:value.green()],
+ [NSNumber numberWithDouble:value.blue()],
+ [NSNumber numberWithDouble:value.alpha()],
+ nil];
+ [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:array];
+}
+
+void PlatformCAAnimationCocoa::setToValue(const FilterOperation* operation, int internalFilterPropertyIndex)
+{
+ RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(operation, internalFilterPropertyIndex);
+ [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:value.get()];
+}
+
+void PlatformCAAnimationCocoa::copyToValueFrom(const PlatformCAAnimation& value)
+{
+ if (animationType() != Basic || value.animationType() != Basic)
+ return;
+
+ CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>(downcast<PlatformCAAnimationCocoa>(value).m_animation.get());
+ [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[otherAnimation toValue]];
+}
+
+
+// Keyframe-animation properties.
+void PlatformCAAnimationCocoa::setValues(const Vector<float>& value)
+{
+ if (animationType() != Keyframe)
+ return;
+
+ NSMutableArray* array = [NSMutableArray array];
+ for (size_t i = 0; i < value.size(); ++i)
+ [array addObject:[NSNumber numberWithDouble:value[i]]];
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
+}
+
+void PlatformCAAnimationCocoa::setValues(const Vector<WebCore::TransformationMatrix>& value)
+{
+ if (animationType() != Keyframe)
+ return;
+
+ NSMutableArray* array = [NSMutableArray array];
+
+ for (size_t i = 0; i < value.size(); ++i)
+ [array addObject:[NSValue valueWithCATransform3D:value[i]]];
+
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
+}
+
+void PlatformCAAnimationCocoa::setValues(const Vector<FloatPoint3D>& value)
+{
+ if (animationType() != Keyframe)
+ return;
+
+ NSMutableArray* array = [NSMutableArray array];
+
+ for (size_t i = 0; i < value.size(); ++i) {
+ NSArray* object = [NSArray arrayWithObjects:
+ [NSNumber numberWithDouble:value[i].x()],
+ [NSNumber numberWithDouble:value[i].y()],
+ [NSNumber numberWithDouble:value[i].z()],
+ nil];
+ [array addObject:object];
+ }
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
+}
+
+void PlatformCAAnimationCocoa::setValues(const Vector<WebCore::Color>& value)
+{
+ if (animationType() != Keyframe)
+ return;
+
+ NSMutableArray* array = [NSMutableArray array];
+
+ for (size_t i = 0; i < value.size(); ++i) {
+ NSArray* object = [NSArray arrayWithObjects:
+ [NSNumber numberWithDouble:value[i].red()],
+ [NSNumber numberWithDouble:value[i].green()],
+ [NSNumber numberWithDouble:value[i].blue()],
+ [NSNumber numberWithDouble:value[i].alpha()],
+ nil];
+ [array addObject:object];
+ }
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
+}
+
+void PlatformCAAnimationCocoa::setValues(const Vector<RefPtr<FilterOperation>>& values, int internalFilterPropertyIndex)
+{
+ if (animationType() != Keyframe)
+ return;
+
+ NSMutableArray* array = [NSMutableArray array];
+
+ for (size_t i = 0; i < values.size(); ++i) {
+ RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(values[i].get(), internalFilterPropertyIndex);
+ [array addObject:value.get()];
+ }
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
+}
+
+void PlatformCAAnimationCocoa::copyValuesFrom(const PlatformCAAnimation& value)
+{
+ if (animationType() != Keyframe || value.animationType() != Keyframe)
+ return;
+
+ CAKeyframeAnimation* otherAnimation = static_cast<CAKeyframeAnimation*>(downcast<PlatformCAAnimationCocoa>(value).m_animation.get());
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:[otherAnimation values]];
+}
+
+void PlatformCAAnimationCocoa::setKeyTimes(const Vector<float>& value)
+{
+ NSMutableArray* array = [NSMutableArray array];
+
+ for (size_t i = 0; i < value.size(); ++i)
+ [array addObject:[NSNumber numberWithFloat:value[i]]];
+
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setKeyTimes:array];
+}
+
+void PlatformCAAnimationCocoa::copyKeyTimesFrom(const PlatformCAAnimation& value)
+{
+ CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>(downcast<PlatformCAAnimationCocoa>(value).m_animation.get());
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setKeyTimes:[other keyTimes]];
+}
+
+void PlatformCAAnimationCocoa::setTimingFunctions(const Vector<const TimingFunction*>& value, bool reverse)
+{
+ NSMutableArray* array = [NSMutableArray array];
+
+ for (size_t i = 0; i < value.size(); ++i)
+ [array addObject:toCAMediaTimingFunction(value[i], reverse)];
+
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setTimingFunctions:array];
+}
+
+void PlatformCAAnimationCocoa::copyTimingFunctionsFrom(const PlatformCAAnimation& value)
+{
+ CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>(downcast<PlatformCAAnimationCocoa>(value).m_animation.get());
+ [static_cast<CAKeyframeAnimation*>(m_animation.get()) setTimingFunctions:[other timingFunctions]];
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCAFiltersCocoammfromrev185855trunkSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,680 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#import "PlatformCAFilters.h"
+
+#import "BlockExceptions.h"
+#import "FloatConversion.h"
+#import "LengthFunctions.h" // This is a layering violation.
+#import "PlatformCALayerCocoa.h"
+#import "QuartzCoreSPI.h"
+#import <QuartzCore/QuartzCore.h>
+
+using namespace WebCore;
+
+// FIXME: Should share these values with FilterEffectRenderer::build() (https://bugs.webkit.org/show_bug.cgi?id=76008).
+static const double sepiaFullConstants[3][3] = {
+ { 0.393, 0.769, 0.189 },
+ { 0.349, 0.686, 0.168 },
+ { 0.272, 0.534, 0.131 }
+};
+
+static const double sepiaNoneConstants[3][3] = {
+ { 1, 0, 0 },
+ { 0, 1, 0 },
+ { 0, 0, 1 }
+};
+
+void PlatformCAFilters::setFiltersOnLayer(PlatformLayer* layer, const FilterOperations& filters)
+{
+ if (!filters.size()) {
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [layer setFilters:nil];
+ // FIXME: this adds shadow properties to the layer even when it had none.
+ [layer setShadowOffset:CGSizeZero];
+ [layer setShadowColor:nil];
+ [layer setShadowRadius:0];
+ [layer setShadowOpacity:0];
+ END_BLOCK_OBJC_EXCEPTIONS
+ return;
+ }
+
+ // Assume filtersCanBeComposited was called and it returned true.
+ ASSERT(PlatformCALayerCocoa::filtersCanBeComposited(filters));
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+
+ RetainPtr<NSMutableArray> array = adoptNS([[NSMutableArray alloc] init]);
+
+ for (unsigned i = 0; i < filters.size(); ++i) {
+ String filterName = String::format("filter_%d", i);
+ const FilterOperation& filterOperation = *filters.at(i);
+ switch (filterOperation.type()) {
+ case FilterOperation::DEFAULT:
+ ASSERT_NOT_REACHED();
+ break;
+ case FilterOperation::DROP_SHADOW: {
+ // FIXME: For now assume drop shadow is the last filter, put it on the layer.
+ // <rdar://problem/10959969> Handle case where drop-shadow is not the last filter.
+ const auto& dropShadowOperation = downcast<DropShadowFilterOperation>(filterOperation);
+ [layer setShadowOffset:CGSizeMake(dropShadowOperation.x(), dropShadowOperation.y())];
+
+ CGFloat components[4];
+ dropShadowOperation.color().getRGBA(components[0], components[1], components[2], components[3]);
+ RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
+ RetainPtr<CGColorRef> color = adoptCF(CGColorCreate(colorSpace.get(), components));
+ [layer setShadowColor:color.get()];
+ [layer setShadowRadius:dropShadowOperation.stdDeviation()];
+ [layer setShadowOpacity:1];
+ break;
+ }
+#if USE_CA_FILTERS
+ case FilterOperation::GRAYSCALE: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMonochrome];
+ [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputAmount"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::SEPIA: {
+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
+ [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::SATURATE: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorSaturate];
+ [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputAmount"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::HUE_ROTATE: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorHueRotate];
+ [filter setValue:[NSNumber numberWithFloat:deg2rad(colorMatrixOperation.amount())] forKey:@"inputAngle"];
+ [filter setName:@"hueRotate"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::INVERT: {
+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
+ [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::OPACITY: {
+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
+ [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::BRIGHTNESS: {
+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
+ [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::CONTRAST: {
+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
+ [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::BLUR: {
+ const auto& blurOperation = downcast<BlurFilterOperation>(filterOperation);
+ CAFilter *filter = [CAFilter filterWithType:kCAFilterGaussianBlur];
+ [filter setValue:[NSNumber numberWithFloat:floatValueForLength(blurOperation.stdDeviation(), 0)] forKey:@"inputRadius"];
+#if ENABLE(FILTERS_LEVEL_2)
+ if (filters.isUsedForBackdropFilters())
+ [filter setValue:[NSNumber numberWithBool:YES] forKey:@"inputNormalizeEdges"];
+#endif
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+#else
+ case FilterOperation::GRAYSCALE: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorMonochrome"];
+ [filter setDefaults];
+ [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputIntensity"];
+ [filter setValue:[CIColor colorWithRed:0.67 green:0.67 blue:0.67] forKey:@"inputColor"]; // Color derived empirically to match zero saturation levels.
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::SEPIA: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
+ [filter setDefaults];
+
+ double t = colorMatrixOperation.amount();
+ t = std::min(std::max(0.0, t), 1.0);
+ // FIXME: results don't match the software filter.
+ [filter setValue:[CIVector vectorWithX:WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], t)
+ Y:WebCore::blend(sepiaNoneConstants[0][1], sepiaFullConstants[0][1], t)
+ Z:WebCore::blend(sepiaNoneConstants[0][2], sepiaFullConstants[0][2], t) W:0] forKey:@"inputRVector"];
+ [filter setValue:[CIVector vectorWithX:WebCore::blend(sepiaNoneConstants[1][0], sepiaFullConstants[1][0], t)
+ Y:WebCore::blend(sepiaNoneConstants[1][1], sepiaFullConstants[1][1], t)
+ Z:WebCore::blend(sepiaNoneConstants[1][2], sepiaFullConstants[1][2], t) W:0] forKey:@"inputGVector"];
+ [filter setValue:[CIVector vectorWithX:WebCore::blend(sepiaNoneConstants[2][0], sepiaFullConstants[2][0], t)
+ Y:WebCore::blend(sepiaNoneConstants[2][1], sepiaFullConstants[2][1], t)
+ Z:WebCore::blend(sepiaNoneConstants[2][2], sepiaFullConstants[2][2], t) W:0] forKey:@"inputBVector"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::SATURATE: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorControls"];
+ [filter setDefaults];
+ [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputSaturation"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::HUE_ROTATE: {
+ const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIHueAdjust"];
+ [filter setDefaults];
+
+ [filter setValue:[NSNumber numberWithFloat:deg2rad(colorMatrixOperation.amount())] forKey:@"inputAngle"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::INVERT: {
+ const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
+ [filter setDefaults];
+
+ double multiplier = 1 - componentTransferOperation.amount() * 2;
+
+ // FIXME: the results of this filter look wrong.
+ [filter setValue:[CIVector vectorWithX:multiplier Y:0 Z:0 W:0] forKey:@"inputRVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:multiplier Z:0 W:0] forKey:@"inputGVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:0 Z:multiplier W:0] forKey:@"inputBVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:1] forKey:@"inputAVector"];
+ [filter setValue:[CIVector vectorWithX:op->amount() Y:op->amount() Z:op->amount() W:0] forKey:@"inputBiasVector"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::OPACITY: {
+ const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
+ [filter setDefaults];
+
+ [filter setValue:[CIVector vectorWithX:1 Y:0 Z:0 W:0] forKey:@"inputRVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:1 Z:0 W:0] forKey:@"inputGVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:0 Z:1 W:0] forKey:@"inputBVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:componentTransferOperation.amount()] forKey:@"inputAVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:0] forKey:@"inputBiasVector"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::BRIGHTNESS: {
+ const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
+ [filter setDefaults];
+ double amount = componentTransferOperation.amount();
+
+ [filter setValue:[CIVector vectorWithX:amount Y:0 Z:0 W:0] forKey:@"inputRVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:amount Z:0 W:0] forKey:@"inputGVector"];
+ [filter setValue:[CIVector vectorWithX:0 Y:0 Z:amount W:0] forKey:@"inputBVector"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::CONTRAST: {
+ const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIColorControls"];
+ [filter setDefaults];
+ [filter setValue:[NSNumber numberWithFloat:componentTransferOperation.amount()] forKey:@"inputContrast"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+ case FilterOperation::BLUR: {
+ // FIXME: For now we ignore stdDeviationY.
+ const auto& blurOperation = downcast<BlurFilterOperation>(filterOperation);
+ CIFilter* filter = [CIFilter filterWithName:@"CIGaussianBlur"];
+ [filter setDefaults];
+ [filter setValue:[NSNumber numberWithFloat:floatValueForLength(blurOperation.stdDeviation(), 0)] forKey:@"inputRadius"];
+ [filter setName:filterName];
+ [array.get() addObject:filter];
+ break;
+ }
+#endif
+ case FilterOperation::PASSTHROUGH:
+ break;
+ default:
+ ASSERT(0);
+ break;
+ }
+ }
+
+ if ([array.get() count] > 0)
+ [layer setFilters:array.get()];
+
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+RetainPtr<NSValue> PlatformCAFilters::filterValueForOperation(const FilterOperation* operation, int internalFilterPropertyIndex)
+{
+#if USE_CA_FILTERS
+ UNUSED_PARAM(internalFilterPropertyIndex);
+#endif
+ FilterOperation::OperationType type = operation->type();
+ RetainPtr<id> value;
+
+ if (is<DefaultFilterOperation>(*operation)) {
+ type = downcast<DefaultFilterOperation>(*operation).representedType();
+ operation = nullptr;
+ }
+
+ switch (type) {
+ case FilterOperation::DEFAULT:
+ ASSERT_NOT_REACHED();
+ break;
+ case FilterOperation::GRAYSCALE: {
+ // CIFilter: inputIntensity
+ // CAFilter: inputAmount
+ double amount = 0;
+ if (operation)
+ amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
+
+ value = [NSNumber numberWithDouble:amount];
+ break;
+ }
+ case FilterOperation::SEPIA: {
+#if USE_CA_FILTERS
+ // CAFilter: inputColorMatrix
+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
+#else
+ // CIFilter: inputRVector, inputGVector, inputBVector
+ double amount = 0;
+ if (operation)
+ amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
+
+ CIVector* rowVector = nullptr;
+ switch (internalFilterPropertyIndex) {
+ case 0: rowVector = [[CIVector alloc] initWithX:WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], amount)
+ Y:WebCore::blend(sepiaNoneConstants[0][1], sepiaFullConstants[0][1], amount)
+ Z:WebCore::blend(sepiaNoneConstants[0][2], sepiaFullConstants[0][2], amount) W:0];
+ break; // inputRVector
+ case 1: rowVector = [[CIVector alloc] initWithX:WebCore::blend(sepiaNoneConstants[1][0], sepiaFullConstants[1][0], amount)
+ Y:WebCore::blend(sepiaNoneConstants[1][1], sepiaFullConstants[1][1], amount)
+ Z:WebCore::blend(sepiaNoneConstants[1][2], sepiaFullConstants[1][2], amount) W:0];
+ break; // inputGVector
+ case 2: rowVector = [[CIVector alloc] initWithX:WebCore::blend(sepiaNoneConstants[2][0], sepiaFullConstants[2][0], amount)
+ Y:WebCore::blend(sepiaNoneConstants[2][1], sepiaFullConstants[2][1], amount)
+ Z:WebCore::blend(sepiaNoneConstants[2][2], sepiaFullConstants[2][2], amount) W:0];
+ break; // inputBVector
+ }
+ value = adoptNS(rowVector);
+#endif
+ break;
+ }
+ case FilterOperation::SATURATE: {
+ // CIFilter: inputSaturation
+ // CAFilter: inputAmount
+ double amount = 1;
+ if (operation)
+ amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
+
+ value = [NSNumber numberWithDouble:amount];
+ break;
+ }
+ case FilterOperation::HUE_ROTATE: {
+ // Hue rotate CIFilter: inputAngle
+ // Hue rotate CAFilter: inputAngle
+ double amount = 0;
+ if (operation)
+ amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
+
+ amount = deg2rad(amount);
+ value = [NSNumber numberWithDouble:amount];
+ break;
+ }
+ case FilterOperation::INVERT: {
+#if USE_CA_FILTERS
+ // CAFilter: inputColorMatrix
+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
+#else
+ // CIFilter: inputRVector, inputGVector, inputBVector, inputBiasVector
+ double amount = 0;
+ if (operation)
+ amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
+
+ double multiplier = 1 - amount * 2;
+
+ // The color matrix animation for invert does a scale of each color component by a value that goes from
+ // 1 (when amount is 0) to -1 (when amount is 1). Then the color values are offset by amount. This has the
+ // effect of performing the operation: c' = c * -1 + 1, which inverts the color.
+ CIVector* rowVector = 0;
+ switch (internalFilterPropertyIndex) {
+ case 0: rowVector = [[CIVector alloc] initWithX:multiplier Y:0 Z:0 W:0]; break; // inputRVector
+ case 1: rowVector = [[CIVector alloc] initWithX:0 Y:multiplier Z:0 W:0]; break; // inputGVector
+ case 2: rowVector = [[CIVector alloc] initWithX:0 Y:0 Z:multiplier W:0]; break; // inputBVector
+ case 3: rowVector = [[CIVector alloc] initWithX:amount Y:amount Z:amount W:0]; break; // inputBiasVector
+ }
+ value = adoptNS(rowVector);
+#endif
+ break;
+ }
+ case FilterOperation::OPACITY: {
+#if USE_CA_FILTERS
+ // Opacity CAFilter: inputColorMatrix
+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
+#else
+ // Opacity CIFilter: inputAVector
+ double amount = 1;
+ if (operation)
+ amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
+
+ value = adoptNS([[CIVector alloc] initWithX:0 Y:0 Z:0 W:amount]);
+#endif
+ break;
+ }
+
+ case FilterOperation::BRIGHTNESS: {
+#if USE_CA_FILTERS
+ // Brightness CAFilter: inputColorMatrix
+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
+#else
+ // Brightness CIFilter: inputColorMatrix
+ double amount = 1;
+ if (operation)
+ amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
+
+ CIVector* rowVector = nullptr;
+ switch (internalFilterPropertyIndex) {
+ case 0: rowVector = [[CIVector alloc] initWithX:amount Y:0 Z:0 W:0]; break; // inputRVector
+ case 1: rowVector = [[CIVector alloc] initWithX:0 Y:amount Z:0 W:0]; break; // inputGVector
+ case 2: rowVector = [[CIVector alloc] initWithX:0 Y:0 Z:amount W:0]; break; // inputBVector
+ }
+ value = adoptNS(rowVector);
+#endif
+ break;
+ }
+
+ case FilterOperation::CONTRAST: {
+#if USE_CA_FILTERS
+ // Contrast CAFilter: inputColorMatrix
+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
+#else
+ // Contrast CIFilter: inputContrast
+ double amount = 1;
+ if (operation)
+ amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
+
+ value = [NSNumber numberWithDouble:amount];
+#endif
+ break;
+ }
+ case FilterOperation::BLUR: {
+ // CIFilter: inputRadius
+ // CAFilter: inputRadius
+ double amount = 0;
+ if (operation)
+ amount = floatValueForLength(downcast<BlurFilterOperation>(*operation).stdDeviation(), 0);
+
+ value = [NSNumber numberWithDouble:amount];
+ break;
+ }
+ default:
+ break;
+ }
+
+ return value;
+}
+
+#if USE_CA_FILTERS
+RetainPtr<NSValue> PlatformCAFilters::colorMatrixValueForFilter(FilterOperation::OperationType type, const FilterOperation* filterOperation)
+{
+ switch (type) {
+ case FilterOperation::SEPIA: {
+ double t = filterOperation ? downcast<BasicColorMatrixFilterOperation>(*filterOperation).amount() : 0;
+ t = std::min(std::max(0.0, t), 1.0);
+ CAColorMatrix colorMatrix = {
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], t)),
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[0][1], sepiaFullConstants[0][1], t)),
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[0][2], sepiaFullConstants[0][2], t)), 0, 0,
+
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[1][0], sepiaFullConstants[1][0], t)),
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[1][1], sepiaFullConstants[1][1], t)),
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[1][2], sepiaFullConstants[1][2], t)), 0, 0,
+
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[2][0], sepiaFullConstants[2][0], t)),
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[2][1], sepiaFullConstants[2][1], t)),
+ static_cast<float>(WebCore::blend(sepiaNoneConstants[2][2], sepiaFullConstants[2][2], t)), 0, 0,
+ 0, 0, 0, 1, 0
+ };
+ return [NSValue valueWithCAColorMatrix:colorMatrix];
+ }
+ case FilterOperation::INVERT: {
+ float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(*filterOperation).amount() : 0;
+ float multiplier = 1 - amount * 2;
+ CAColorMatrix colorMatrix = {
+ multiplier, 0, 0, 0, amount,
+ 0, multiplier, 0, 0, amount,
+ 0, 0, multiplier, 0, amount,
+ 0, 0, 0, 1, 0
+ };
+ return [NSValue valueWithCAColorMatrix:colorMatrix];
+ }
+ case FilterOperation::OPACITY: {
+ float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(filterOperation)->amount() : 1;
+ CAColorMatrix colorMatrix = {
+ 1, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0,
+ 0, 0, 1, 0, 0,
+ 0, 0, 0, amount, 0
+ };
+ return [NSValue valueWithCAColorMatrix:colorMatrix];
+ }
+ case FilterOperation::CONTRAST: {
+ float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(filterOperation)->amount() : 1;
+ float intercept = -0.5 * amount + 0.5;
+ CAColorMatrix colorMatrix = {
+ amount, 0, 0, 0, intercept,
+ 0, amount, 0, 0, intercept,
+ 0, 0, amount, 0, intercept,
+ 0, 0, 0, 1, 0
+ };
+ return [NSValue valueWithCAColorMatrix:colorMatrix];
+ }
+ case FilterOperation::BRIGHTNESS: {
+ float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(filterOperation)->amount() : 1;
+ CAColorMatrix colorMatrix = {
+ amount, 0, 0, 0, 0,
+ 0, amount, 0, 0, 0,
+ 0, 0, amount, 0, 0,
+ 0, 0, 0, 1, 0
+ };
+ return [NSValue valueWithCAColorMatrix:colorMatrix];
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+}
+#endif
+
+void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformLayer* layer, const BlendMode blendMode)
+{
+#if USE_CA_FILTERS
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+
+ CAFilter* filter = nil;
+
+ switch (blendMode) {
+ case BlendModeNormal:
+ // No need to set an actual filter object in this case.
+ break;
+ case BlendModeOverlay:
+ filter = [CAFilter filterWithType:kCAFilterOverlayBlendMode];
+ break;
+ case BlendModeColorDodge:
+ filter = [CAFilter filterWithType:kCAFilterColorDodgeBlendMode];
+ break;
+ case BlendModeColorBurn:
+ filter = [CAFilter filterWithType:kCAFilterColorBurnBlendMode];
+ break;
+ case BlendModeDarken:
+ filter = [CAFilter filterWithType:kCAFilterDarkenBlendMode];
+ break;
+ case BlendModeDifference:
+ filter = [CAFilter filterWithType:kCAFilterDifferenceBlendMode];
+ break;
+ case BlendModeExclusion:
+ filter = [CAFilter filterWithType:kCAFilterExclusionBlendMode];
+ break;
+ case BlendModeHardLight:
+ filter = [CAFilter filterWithType:kCAFilterHardLightBlendMode];
+ break;
+ case BlendModeMultiply:
+ filter = [CAFilter filterWithType:kCAFilterMultiplyBlendMode];
+ break;
+ case BlendModeLighten:
+ filter = [CAFilter filterWithType:kCAFilterLightenBlendMode];
+ break;
+ case BlendModeSoftLight:
+ filter = [CAFilter filterWithType:kCAFilterSoftLightBlendMode];
+ break;
+ case BlendModeScreen:
+ filter = [CAFilter filterWithType:kCAFilterScreenBlendMode];
+ break;
+ case BlendModePlusDarker:
+ filter = [CAFilter filterWithType:kCAFilterPlusD];
+ break;
+ case BlendModePlusLighter:
+ filter = [CAFilter filterWithType:kCAFilterPlusL];
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ [layer setCompositingFilter:filter];
+
+ END_BLOCK_OBJC_EXCEPTIONS
+#else
+ UNUSED_PARAM(layer);
+ UNUSED_PARAM(blendMode);
+#endif
+}
+
+int PlatformCAFilters::numAnimatedFilterProperties(FilterOperation::OperationType type)
+{
+#if USE_CA_FILTERS
+ switch (type) {
+ case FilterOperation::GRAYSCALE: return 1;
+ case FilterOperation::SEPIA: return 1;
+ case FilterOperation::SATURATE: return 1;
+ case FilterOperation::HUE_ROTATE: return 1;
+ case FilterOperation::INVERT: return 1;
+ case FilterOperation::OPACITY: return 1;
+ case FilterOperation::BRIGHTNESS: return 1;
+ case FilterOperation::CONTRAST: return 1;
+ case FilterOperation::BLUR: return 1;
+ default: return 0;
+ }
+#else
+ switch (type) {
+ case FilterOperation::GRAYSCALE: return 1;
+ case FilterOperation::SEPIA: return 3;
+ case FilterOperation::SATURATE: return 1;
+ case FilterOperation::HUE_ROTATE: return 1;
+ case FilterOperation::INVERT: return 4;
+ case FilterOperation::OPACITY: return 1;
+ case FilterOperation::BRIGHTNESS: return 3;
+ case FilterOperation::CONTRAST: return 1;
+ case FilterOperation::BLUR: return 1;
+ default: return 0;
+ }
+#endif
+}
+
+const char* PlatformCAFilters::animatedFilterPropertyName(FilterOperation::OperationType type, int internalFilterPropertyIndex)
+{
+#if USE_CA_FILTERS
+ UNUSED_PARAM(internalFilterPropertyIndex);
+ switch (type) {
+ case FilterOperation::GRAYSCALE: return "inputAmount";
+ case FilterOperation::SEPIA:return "inputColorMatrix";
+ case FilterOperation::SATURATE: return "inputAmount";
+ case FilterOperation::HUE_ROTATE: return "inputAngle";
+ case FilterOperation::INVERT: return "inputColorMatrix";
+ case FilterOperation::OPACITY: return "inputColorMatrix";
+ case FilterOperation::BRIGHTNESS: return "inputColorMatrix";
+ case FilterOperation::CONTRAST: return "inputColorMatrix";
+ case FilterOperation::BLUR: return "inputRadius";
+ default: return "";
+ }
+#else
+ switch (type) {
+ case FilterOperation::GRAYSCALE: return "inputIntensity";
+ case FilterOperation::SEPIA:
+ case FilterOperation::BRIGHTNESS:
+ switch (internalFilterPropertyIndex) {
+ case 0: return "inputRVector";
+ case 1: return "inputGVector";
+ case 2: return "inputBVector";
+ default: return "";
+ }
+ case FilterOperation::SATURATE: return "inputSaturation";
+ case FilterOperation::HUE_ROTATE: return "inputAngle";
+ case FilterOperation::INVERT:
+ switch (internalFilterPropertyIndex) {
+ case 0: return "inputRVector";
+ case 1: return "inputGVector";
+ case 2: return "inputBVector";
+ case 3: return "inputBiasVector";
+ default: return "";
+ }
+ case FilterOperation::OPACITY: return "inputAVector";
+ case FilterOperation::CONTRAST: return "inputContrast";
+ case FilterOperation::BLUR: return "inputRadius";
+ default: return "";
+ }
+#endif
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoahfromrev185855trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,185 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformCALayerCocoa_h
+#define PlatformCALayerCocoa_h
+
+#include "PlatformCALayer.h"
+
+OBJC_CLASS NSObject;
+
+namespace WebCore {
+
+class PlatformCALayerCocoa final : public PlatformCALayer {
+public:
+ static PassRefPtr<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
+
+ // This function passes the layer as a void* rather than a PlatformLayer because PlatformLayer
+ // is defined differently for Obj C and C++. This allows callers from both languages.
+ static PassRefPtr<PlatformCALayer> create(void* platformLayer, PlatformCALayerClient*);
+
+ WEBCORE_EXPORT static LayerType layerTypeForPlatformLayer(PlatformLayer*);
+
+ ~PlatformCALayerCocoa();
+
+ virtual void setOwner(PlatformCALayerClient*) override;
+
+ virtual void setNeedsDisplay() override;
+ virtual void setNeedsDisplayInRect(const FloatRect& dirtyRect) override;
+
+ virtual void copyContentsFromLayer(PlatformCALayer*) override;
+
+ virtual PlatformCALayer* superlayer() const override;
+ virtual void removeFromSuperlayer() override;
+ virtual void setSublayers(const PlatformCALayerList&) override;
+ virtual void removeAllSublayers() override;
+ virtual void appendSublayer(PlatformCALayer&) override;
+ virtual void insertSublayer(PlatformCALayer&, size_t index) override;
+ virtual void replaceSublayer(PlatformCALayer& reference, PlatformCALayer&) override;
+ virtual const PlatformCALayerList* customSublayers() const override { return m_customSublayers.get(); }
+ virtual void adoptSublayers(PlatformCALayer& source) override;
+
+ virtual void addAnimationForKey(const String& key, PlatformCAAnimation&) override;
+ virtual void removeAnimationForKey(const String& key) override;
+ virtual PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
+ virtual void animationStarted(const String& key, CFTimeInterval beginTime) override;
+ virtual void animationEnded(const String& key) override;
+
+ virtual void setMask(PlatformCALayer*) override;
+
+ virtual bool isOpaque() const override;
+ virtual void setOpaque(bool) override;
+
+ virtual FloatRect bounds() const override;
+ virtual void setBounds(const FloatRect&) override;
+
+ virtual FloatPoint3D position() const override;
+ virtual void setPosition(const FloatPoint3D&) override;
+
+ virtual FloatPoint3D anchorPoint() const override;
+ virtual void setAnchorPoint(const FloatPoint3D&) override;
+
+ virtual TransformationMatrix transform() const override;
+ virtual void setTransform(const TransformationMatrix&) override;
+
+ virtual TransformationMatrix sublayerTransform() const override;
+ virtual void setSublayerTransform(const TransformationMatrix&) override;
+
+ virtual void setHidden(bool) override;
+
+ virtual void setBackingStoreAttached(bool) override;
+ virtual bool backingStoreAttached() const override;
+
+ WEBCORE_EXPORT virtual void setGeometryFlipped(bool) override;
+
+ virtual bool isDoubleSided() const override;
+ virtual void setDoubleSided(bool) override;
+
+ virtual bool masksToBounds() const override;
+ virtual void setMasksToBounds(bool) override;
+
+ virtual bool acceleratesDrawing() const override;
+ virtual void setAcceleratesDrawing(bool) override;
+
+ virtual CFTypeRef contents() const override;
+ virtual void setContents(CFTypeRef) override;
+
+ virtual void setContentsRect(const FloatRect&) override;
+
+ virtual void setMinificationFilter(FilterType) override;
+ virtual void setMagnificationFilter(FilterType) override;
+
+ virtual Color backgroundColor() const override;
+ virtual void setBackgroundColor(const Color&) override;
+
+ virtual void setBorderWidth(float) override;
+
+ virtual void setBorderColor(const Color&) override;
+
+ virtual float opacity() const override;
+ virtual void setOpacity(float) override;
+ virtual void setFilters(const FilterOperations&) override;
+ WEBCORE_EXPORT static bool filtersCanBeComposited(const FilterOperations&);
+ virtual void copyFiltersFrom(const PlatformCALayer&) override;
+
+#if ENABLE(CSS_COMPOSITING)
+ virtual void setBlendMode(BlendMode) override;
+#endif
+
+ virtual void setName(const String&) override;
+
+ virtual void setSpeed(float) override;
+
+ virtual void setTimeOffset(CFTimeInterval) override;
+
+ virtual float contentsScale() const override;
+ virtual void setContentsScale(float) override;
+
+ virtual float cornerRadius() const override;
+ virtual void setCornerRadius(float) override;
+
+ virtual void setEdgeAntialiasingMask(unsigned) override;
+
+ virtual FloatRoundedRect shapeRoundedRect() const override;
+ virtual void setShapeRoundedRect(const FloatRoundedRect&) override;
+
+ virtual Path shapePath() const override;
+ virtual void setShapePath(const Path&) override;
+
+ virtual WindRule shapeWindRule() const override;
+ virtual void setShapeWindRule(WindRule) override;
+
+ virtual GraphicsLayer::CustomAppearance customAppearance() const override { return m_customAppearance; }
+ virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) override;
+
+ virtual TiledBacking* tiledBacking() override;
+
+ virtual PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
+
+ virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
+
+ virtual void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
+
+private:
+ PlatformCALayerCocoa(LayerType, PlatformCALayerClient* owner);
+ PlatformCALayerCocoa(PlatformLayer*, PlatformCALayerClient* owner);
+
+ void commonInit();
+
+ virtual bool isPlatformCALayerCocoa() const override { return true; }
+
+ bool requiresCustomAppearanceUpdateOnBoundsChange() const;
+
+ RetainPtr<NSObject> m_delegate;
+ std::unique_ptr<PlatformCALayerList> m_customSublayers;
+ GraphicsLayer::CustomAppearance m_customAppearance;
+ std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebCore::PlatformCALayerCocoa, isPlatformCALayerCocoa())
+
+#endif // PlatformCALayerCocoa_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoah"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoammfromrev185855trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,1109 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#import "PlatformCALayerCocoa.h"
+
+#import "AnimationUtilities.h"
+#import "BlockExceptions.h"
+#import "FontAntialiasingStateSaver.h"
+#import "GraphicsContext.h"
+#import "GraphicsLayerCA.h"
+#import "LengthFunctions.h"
+#import "PlatformCAAnimationCocoa.h"
+#import "PlatformCAFilters.h"
+#import "QuartzCoreSPI.h"
+#import "ScrollbarThemeMac.h"
+#import "SoftLinking.h"
+#import "TileController.h"
+#import "TiledBacking.h"
+#import "WebActionDisablingCALayerDelegate.h"
+#import "WebCoreCALayerExtras.h"
+#import "WebGLLayer.h"
+#import "WebLayer.h"
+#import "WebTiledBackingLayer.h"
+#import <AVFoundation/AVFoundation.h>
+#import <QuartzCore/QuartzCore.h>
+#import <objc/objc-auto.h>
+#import <objc/runtime.h>
+#import <wtf/CurrentTime.h>
+#import <wtf/RetainPtr.h>
+
+#if PLATFORM(IOS)
+#import "WAKWindow.h"
+#import "WKGraphics.h"
+#import "WebCoreThread.h"
+#import "WebTiledLayer.h"
+#else
+#import "ThemeMac.h"
+#endif
+
+#if ENABLE(FILTERS_LEVEL_2)
+@interface CABackdropLayer : CALayer
+@end
+#endif
+
+SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
+SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
+
+using namespace WebCore;
+
+PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::create(LayerType layerType, PlatformCALayerClient* owner)
+{
+ return adoptRef(new PlatformCALayerCocoa(layerType, owner));
+}
+
+PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::create(void* platformLayer, PlatformCALayerClient* owner)
+{
+ return adoptRef(new PlatformCALayerCocoa(static_cast<PlatformLayer*>(platformLayer), owner));
+}
+
+static NSString * const platformCALayerPointer = @"WKPlatformCALayer";
+PlatformCALayer* PlatformCALayer::platformCALayer(void* platformLayer)
+{
+ if (!platformLayer)
+ return 0;
+
+ // Pointer to PlatformCALayer is kept in a key of the CALayer
+ PlatformCALayer* platformCALayer = nil;
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ platformCALayer = static_cast<PlatformCALayer*>([[static_cast<CALayer*>(platformLayer) valueForKey:platformCALayerPointer] pointerValue]);
+ END_BLOCK_OBJC_EXCEPTIONS
+ return platformCALayer;
+}
+
+static double mediaTimeToCurrentTime(CFTimeInterval t)
+{
+ return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
+}
+
+// Delegate for animationDidStart callback
+@interface WebAnimationDelegate : NSObject {
+ PlatformCALayer* m_owner;
+}
+
+- (void)animationDidStart:(CAAnimation *)anim;
+- (void)setOwner:(PlatformCALayer*)owner;
+
+@end
+
+@implementation WebAnimationDelegate
+
+- (void)animationDidStart:(CAAnimation *)animation
+{
+#if PLATFORM(IOS)
+ WebThreadLock();
+#endif
+ if (!m_owner)
+ return;
+
+ CFTimeInterval startTime;
+ if (hasExplicitBeginTime(animation)) {
+ // We don't know what time CA used to commit the animation, so just use the current time
+ // (even though this will be slightly off).
+ startTime = mediaTimeToCurrentTime(CACurrentMediaTime());
+ } else
+ startTime = mediaTimeToCurrentTime([animation beginTime]);
+
+ CALayer *layer = m_owner->platformLayer();
+
+ String animationKey;
+ for (NSString *key in [layer animationKeys]) {
+ if ([layer animationForKey:key] == animation) {
+ animationKey = key;
+ break;
+ }
+ }
+
+ if (!animationKey.isEmpty())
+ m_owner->animationStarted(animationKey, startTime);
+}
+
+- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
+{
+#if PLATFORM(IOS)
+ WebThreadLock();
+#endif
+ UNUSED_PARAM(finished);
+
+ if (!m_owner)
+ return;
+
+ CALayer *layer = m_owner->platformLayer();
+
+ String animationKey;
+ for (NSString *key in [layer animationKeys]) {
+ if ([layer animationForKey:key] == animation) {
+ animationKey = key;
+ break;
+ }
+ }
+
+ if (!animationKey.isEmpty())
+ m_owner->animationEnded(animationKey);
+}
+
+- (void)setOwner:(PlatformCALayer*)owner
+{
+ m_owner = owner;
+}
+
+@end
+
+void PlatformCALayerCocoa::setOwner(PlatformCALayerClient* owner)
+{
+ PlatformCALayer::setOwner(owner);
+
+ // Change the delegate's owner if needed
+ if (m_delegate)
+ [static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:this];
+}
+
+static NSString *toCAFilterType(PlatformCALayer::FilterType type)
+{
+ switch (type) {
+ case PlatformCALayer::Linear: return kCAFilterLinear;
+ case PlatformCALayer::Nearest: return kCAFilterNearest;
+ case PlatformCALayer::Trilinear: return kCAFilterTrilinear;
+ default: return 0;
+ }
+}
+
+PlatformCALayer::LayerType PlatformCALayerCocoa::layerTypeForPlatformLayer(PlatformLayer* layer)
+{
+ if ([layer isKindOfClass:getAVPlayerLayerClass()] || [layer isKindOfClass:objc_getClass("WebVideoContainerLayer")])
+ return LayerTypeAVPlayerLayer;
+
+ if ([layer isKindOfClass:[WebGLLayer class]])
+ return LayerTypeWebGLLayer;
+
+ return LayerTypeCustom;
+}
+
+PlatformCALayerCocoa::PlatformCALayerCocoa(LayerType layerType, PlatformCALayerClient* owner)
+ : PlatformCALayer(layerType, owner)
+ , m_customAppearance(GraphicsLayer::NoCustomAppearance)
+{
+ Class layerClass = Nil;
+ switch (layerType) {
+ case LayerTypeLayer:
+ case LayerTypeRootLayer:
+ layerClass = [CALayer class];
+ break;
+ case LayerTypeScrollingLayer:
+ // Scrolling layers only have special behavior with PlatformCALayerRemote.
+ // fallthrough
+ case LayerTypeWebLayer:
+ layerClass = [WebLayer class];
+ break;
+ case LayerTypeSimpleLayer:
+ case LayerTypeTiledBackingTileLayer:
+ layerClass = [WebSimpleLayer class];
+ break;
+ case LayerTypeTransformLayer:
+ layerClass = [CATransformLayer class];
+ break;
+ case LayerTypeBackdropLayer:
+ case LayerTypeLightSystemBackdropLayer:
+ case LayerTypeDarkSystemBackdropLayer:
+#if ENABLE(FILTERS_LEVEL_2)
+ layerClass = [CABackdropLayer class];
+#else
+ ASSERT_NOT_REACHED();
+ layerClass = [CALayer class];
+#endif
+ break;
+ case LayerTypeWebTiledLayer:
+ ASSERT_NOT_REACHED();
+ break;
+ case LayerTypeTiledBackingLayer:
+ case LayerTypePageTiledBackingLayer:
+ layerClass = [WebTiledBackingLayer class];
+ break;
+ case LayerTypeAVPlayerLayer:
+ layerClass = getAVPlayerLayerClass();
+ break;
+ case LayerTypeWebGLLayer:
+ // We don't create PlatformCALayerCocoas wrapped around WebGLLayers.
+ ASSERT_NOT_REACHED();
+ break;
+ case LayerTypeShapeLayer:
+ layerClass = [CAShapeLayer class];
+ // fillColor defaults to opaque black.
+ break;
+ case LayerTypeCustom:
+ break;
+ }
+
+ if (layerClass)
+ m_layer = adoptNS([(CALayer *)[layerClass alloc] init]);
+
+ commonInit();
+}
+
+PlatformCALayerCocoa::PlatformCALayerCocoa(PlatformLayer* layer, PlatformCALayerClient* owner)
+ : PlatformCALayer(layerTypeForPlatformLayer(layer), owner)
+ , m_customAppearance(GraphicsLayer::NoCustomAppearance)
+{
+ m_layer = layer;
+ commonInit();
+}
+
+void PlatformCALayerCocoa::commonInit()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ // Save a pointer to 'this' in the CALayer
+ [m_layer setValue:[NSValue valueWithPointer:this] forKey:platformCALayerPointer];
+
+ // Clear all the implicit animations on the CALayer
+ if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeScrollingLayer || m_layerType == LayerTypeCustom)
+ [m_layer web_disableAllActions];
+ else
+ [m_layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
+
+ // So that the scrolling thread's performance logging code can find all the tiles, mark this as being a tile.
+ if (m_layerType == LayerTypeTiledBackingTileLayer)
+ [m_layer setValue:@YES forKey:@"isTile"];
+
+ if (usesTiledBackingLayer()) {
+ WebTiledBackingLayer* tiledBackingLayer = static_cast<WebTiledBackingLayer*>(m_layer.get());
+ TileController* tileController = [tiledBackingLayer createTileController:this];
+
+ m_customSublayers = std::make_unique<PlatformCALayerList>(tileController->containerLayers());
+ }
+
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::clone(PlatformCALayerClient* owner) const
+{
+ LayerType type;
+ switch (layerType()) {
+ case LayerTypeTransformLayer:
+ type = LayerTypeTransformLayer;
+ break;
+ case LayerTypeAVPlayerLayer:
+ type = LayerTypeAVPlayerLayer;
+ break;
+ case LayerTypeShapeLayer:
+ type = LayerTypeShapeLayer;
+ break;
+ case LayerTypeLayer:
+ default:
+ type = LayerTypeLayer;
+ break;
+ };
+ RefPtr<PlatformCALayer> newLayer = PlatformCALayerCocoa::create(type, owner);
+
+ newLayer->setPosition(position());
+ newLayer->setBounds(bounds());
+ newLayer->setAnchorPoint(anchorPoint());
+ newLayer->setTransform(transform());
+ newLayer->setSublayerTransform(sublayerTransform());
+ newLayer->setContents(contents());
+ newLayer->setMasksToBounds(masksToBounds());
+ newLayer->setDoubleSided(isDoubleSided());
+ newLayer->setOpaque(isOpaque());
+ newLayer->setBackgroundColor(backgroundColor());
+ newLayer->setContentsScale(contentsScale());
+ newLayer->setCornerRadius(cornerRadius());
+ newLayer->copyFiltersFrom(*this);
+ newLayer->updateCustomAppearance(customAppearance());
+
+ if (type == LayerTypeAVPlayerLayer) {
+ ASSERT([newLayer->platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
+ ASSERT([platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
+
+ AVPlayerLayer* destinationPlayerLayer = static_cast<AVPlayerLayer *>(newLayer->platformLayer());
+ AVPlayerLayer* sourcePlayerLayer = static_cast<AVPlayerLayer *>(platformLayer());
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [destinationPlayerLayer setPlayer:[sourcePlayerLayer player]];
+ });
+ }
+
+ if (type == LayerTypeShapeLayer)
+ newLayer->setShapeRoundedRect(shapeRoundedRect());
+
+ return newLayer;
+}
+
+PlatformCALayerCocoa::~PlatformCALayerCocoa()
+{
+ [m_layer setValue:nil forKey:platformCALayerPointer];
+
+ // Remove the owner pointer from the delegate in case there is a pending animationStarted event.
+ [static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:nil];
+
+ if (usesTiledBackingLayer())
+ [static_cast<WebTiledBackingLayer *>(m_layer.get()) invalidate];
+}
+
+void PlatformCALayerCocoa::animationStarted(const String& animationKey, CFTimeInterval beginTime)
+{
+ if (m_owner)
+ m_owner->platformCALayerAnimationStarted(animationKey, beginTime);
+}
+
+void PlatformCALayerCocoa::animationEnded(const String& animationKey)
+{
+ if (m_owner)
+ m_owner->platformCALayerAnimationEnded(animationKey);
+}
+
+void PlatformCALayerCocoa::setNeedsDisplay()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setNeedsDisplay];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setNeedsDisplayInRect(const FloatRect& dirtyRect)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setNeedsDisplayInRect:dirtyRect];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::copyContentsFromLayer(PlatformCALayer* layer)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ CALayer* caLayer = layer->m_layer.get();
+ if ([m_layer contents] != [caLayer contents])
+ [m_layer setContents:[caLayer contents]];
+ else
+ [m_layer setContentsChanged];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+PlatformCALayer* PlatformCALayerCocoa::superlayer() const
+{
+ return platformCALayer([m_layer superlayer]);
+}
+
+void PlatformCALayerCocoa::removeFromSuperlayer()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer removeFromSuperlayer];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setSublayers(const PlatformCALayerList& list)
+{
+ // Short circuiting here avoids the allocation of the array below.
+ if (!list.size()) {
+ removeAllSublayers();
+ return;
+ }
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ NSMutableArray* sublayers = [[NSMutableArray alloc] init];
+ for (size_t i = 0; i < list.size(); ++i)
+ [sublayers addObject:list[i]->m_layer.get()];
+
+ [m_layer setSublayers:sublayers];
+ [sublayers release];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::removeAllSublayers()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setSublayers:nil];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::appendSublayer(PlatformCALayer& layer)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ ASSERT(m_layer != layer.m_layer);
+ [m_layer addSublayer:layer.m_layer.get()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::insertSublayer(PlatformCALayer& layer, size_t index)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ ASSERT(m_layer != layer.m_layer);
+ [m_layer insertSublayer:layer.m_layer.get() atIndex:index];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::replaceSublayer(PlatformCALayer& reference, PlatformCALayer& layer)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ ASSERT(m_layer != layer.m_layer);
+ [m_layer replaceSublayer:reference.m_layer.get() with:layer.m_layer.get()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::adoptSublayers(PlatformCALayer& source)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setSublayers:[source.m_layer.get() sublayers]];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::addAnimationForKey(const String& key, PlatformCAAnimation& animation)
+{
+ // Add the delegate
+ if (!m_delegate) {
+ WebAnimationDelegate* webAnimationDelegate = [[WebAnimationDelegate alloc] init];
+ m_delegate = adoptNS(webAnimationDelegate);
+ [webAnimationDelegate setOwner:this];
+ }
+
+ CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>(downcast<PlatformCAAnimationCocoa>(animation).platformAnimation());
+ if (![propertyAnimation delegate])
+ [propertyAnimation setDelegate:static_cast<id>(m_delegate.get())];
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer addAnimation:propertyAnimation forKey:key];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::removeAnimationForKey(const String& key)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer removeAnimationForKey:key];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+PassRefPtr<PlatformCAAnimation> PlatformCALayerCocoa::animationForKey(const String& key)
+{
+ CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>([m_layer animationForKey:key]);
+ if (!propertyAnimation)
+ return 0;
+ return PlatformCAAnimationCocoa::create(propertyAnimation);
+}
+
+void PlatformCALayerCocoa::setMask(PlatformCALayer* layer)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setMask:layer ? layer->platformLayer() : nil];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+bool PlatformCALayerCocoa::isOpaque() const
+{
+ return [m_layer isOpaque];
+}
+
+void PlatformCALayerCocoa::setOpaque(bool value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setOpaque:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+FloatRect PlatformCALayerCocoa::bounds() const
+{
+ return [m_layer bounds];
+}
+
+void PlatformCALayerCocoa::setBounds(const FloatRect& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setBounds:value];
+
+ if (requiresCustomAppearanceUpdateOnBoundsChange())
+ updateCustomAppearance(m_customAppearance);
+
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+FloatPoint3D PlatformCALayerCocoa::position() const
+{
+ CGPoint point = [m_layer position];
+ return FloatPoint3D(point.x, point.y, [m_layer zPosition]);
+}
+
+void PlatformCALayerCocoa::setPosition(const FloatPoint3D& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setPosition:CGPointMake(value.x(), value.y())];
+ [m_layer setZPosition:value.z()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+FloatPoint3D PlatformCALayerCocoa::anchorPoint() const
+{
+ CGPoint point = [m_layer anchorPoint];
+ float z = 0;
+ z = [m_layer anchorPointZ];
+ return FloatPoint3D(point.x, point.y, z);
+}
+
+void PlatformCALayerCocoa::setAnchorPoint(const FloatPoint3D& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setAnchorPoint:CGPointMake(value.x(), value.y())];
+ [m_layer setAnchorPointZ:value.z()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+TransformationMatrix PlatformCALayerCocoa::transform() const
+{
+ return [m_layer transform];
+}
+
+void PlatformCALayerCocoa::setTransform(const TransformationMatrix& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setTransform:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+TransformationMatrix PlatformCALayerCocoa::sublayerTransform() const
+{
+ return [m_layer sublayerTransform];
+}
+
+void PlatformCALayerCocoa::setSublayerTransform(const TransformationMatrix& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setSublayerTransform:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setHidden(bool value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setHidden:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setBackingStoreAttached(bool)
+{
+ // We could throw away backing store here with setContents:nil.
+}
+
+bool PlatformCALayerCocoa::backingStoreAttached() const
+{
+ return true;
+}
+
+void PlatformCALayerCocoa::setGeometryFlipped(bool value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setGeometryFlipped:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+bool PlatformCALayerCocoa::isDoubleSided() const
+{
+ return [m_layer isDoubleSided];
+}
+
+void PlatformCALayerCocoa::setDoubleSided(bool value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setDoubleSided:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+bool PlatformCALayerCocoa::masksToBounds() const
+{
+ return [m_layer masksToBounds];
+}
+
+void PlatformCALayerCocoa::setMasksToBounds(bool value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setMasksToBounds:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+bool PlatformCALayerCocoa::acceleratesDrawing() const
+{
+ return [m_layer acceleratesDrawing];
+}
+
+void PlatformCALayerCocoa::setAcceleratesDrawing(bool acceleratesDrawing)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setAcceleratesDrawing:acceleratesDrawing];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+CFTypeRef PlatformCALayerCocoa::contents() const
+{
+ return [m_layer contents];
+}
+
+void PlatformCALayerCocoa::setContents(CFTypeRef value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setContents:static_cast<id>(const_cast<void*>(value))];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setContentsRect(const FloatRect& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setContentsRect:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setMinificationFilter(FilterType value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setMinificationFilter:toCAFilterType(value)];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setMagnificationFilter(FilterType value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setMagnificationFilter:toCAFilterType(value)];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+Color PlatformCALayerCocoa::backgroundColor() const
+{
+ return [m_layer backgroundColor];
+}
+
+void PlatformCALayerCocoa::setBackgroundColor(const Color& value)
+{
+ CGFloat components[4];
+ value.getRGBA(components[0], components[1], components[2], components[3]);
+
+ RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
+ RetainPtr<CGColorRef> color = adoptCF(CGColorCreate(colorSpace.get(), components));
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setBackgroundColor:color.get()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setBorderWidth(float value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setBorderWidth:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setBorderColor(const Color& value)
+{
+ if (value.isValid()) {
+ CGFloat components[4];
+ value.getRGBA(components[0], components[1], components[2], components[3]);
+
+ RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
+ RetainPtr<CGColorRef> color = adoptCF(CGColorCreate(colorSpace.get(), components));
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setBorderColor:color.get()];
+ END_BLOCK_OBJC_EXCEPTIONS
+ } else {
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setBorderColor:nil];
+ END_BLOCK_OBJC_EXCEPTIONS
+ }
+}
+
+float PlatformCALayerCocoa::opacity() const
+{
+ return [m_layer opacity];
+}
+
+void PlatformCALayerCocoa::setOpacity(float value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setOpacity:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setFilters(const FilterOperations& filters)
+{
+ PlatformCAFilters::setFiltersOnLayer(platformLayer(), filters);
+}
+
+void PlatformCALayerCocoa::copyFiltersFrom(const PlatformCALayer& sourceLayer)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setFilters:[sourceLayer.platformLayer() filters]];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+bool PlatformCALayerCocoa::filtersCanBeComposited(const FilterOperations& filters)
+{
+ // Return false if there are no filters to avoid needless work
+ if (!filters.size())
+ return false;
+
+ for (unsigned i = 0; i < filters.size(); ++i) {
+ const FilterOperation* filterOperation = filters.at(i);
+ switch (filterOperation->type()) {
+ case FilterOperation::REFERENCE:
+ return false;
+ case FilterOperation::DROP_SHADOW:
+ // FIXME: For now we can only handle drop-shadow is if it's last in the list
+ if (i < (filters.size() - 1))
+ return false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return true;
+}
+
+#if ENABLE(CSS_COMPOSITING)
+void PlatformCALayerCocoa::setBlendMode(BlendMode blendMode)
+{
+ PlatformCAFilters::setBlendingFiltersOnLayer(platformLayer(), blendMode);
+}
+#endif
+
+void PlatformCALayerCocoa::setName(const String& value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setName:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setSpeed(float value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setSpeed:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setTimeOffset(CFTimeInterval value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setTimeOffset:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+float PlatformCALayerCocoa::contentsScale() const
+{
+ return [m_layer contentsScale];
+}
+
+void PlatformCALayerCocoa::setContentsScale(float value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setContentsScale:value];
+#if PLATFORM(IOS)
+ [m_layer setRasterizationScale:value];
+
+ if (m_layerType == LayerTypeWebTiledLayer) {
+ // This will invalidate all the tiles so we won't end up with stale tiles with the wrong scale in the wrong place,
+ // see <rdar://problem/9434765> for more information.
+ static NSDictionary *optionsDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCATiledLayerRemoveImmediately, nil];
+ [(CATiledLayer *)m_layer.get() setNeedsDisplayInRect:[m_layer bounds] levelOfDetail:0 options:optionsDictionary];
+ }
+#endif
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+float PlatformCALayerCocoa::cornerRadius() const
+{
+ return [m_layer cornerRadius];
+}
+
+void PlatformCALayerCocoa::setCornerRadius(float value)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setCornerRadius:value];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setEdgeAntialiasingMask(unsigned mask)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [m_layer setEdgeAntialiasingMask:mask];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+FloatRoundedRect PlatformCALayerCocoa::shapeRoundedRect() const
+{
+ ASSERT(m_layerType == LayerTypeShapeLayer);
+ if (m_shapeRoundedRect)
+ return *m_shapeRoundedRect;
+
+ return FloatRoundedRect();
+}
+
+void PlatformCALayerCocoa::setShapeRoundedRect(const FloatRoundedRect& roundedRect)
+{
+ ASSERT(m_layerType == LayerTypeShapeLayer);
+ m_shapeRoundedRect = std::make_unique<FloatRoundedRect>(roundedRect);
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ Path shapePath;
+ shapePath.addRoundedRect(roundedRect);
+ [(CAShapeLayer *)m_layer setPath:shapePath.platformPath()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+WindRule PlatformCALayerCocoa::shapeWindRule() const
+{
+ ASSERT(m_layerType == LayerTypeShapeLayer);
+
+ NSString *fillRule = [(CAShapeLayer *)m_layer fillRule];
+ if ([fillRule isEqualToString:@"even-odd"])
+ return RULE_EVENODD;
+
+ return RULE_NONZERO;
+}
+
+void PlatformCALayerCocoa::setShapeWindRule(WindRule windRule)
+{
+ ASSERT(m_layerType == LayerTypeShapeLayer);
+
+ switch (windRule) {
+ case RULE_NONZERO:
+ [(CAShapeLayer *)m_layer setFillRule:@"non-zero"];
+ break;
+ case RULE_EVENODD:
+ [(CAShapeLayer *)m_layer setFillRule:@"even-odd"];
+ break;
+ }
+}
+
+Path PlatformCALayerCocoa::shapePath() const
+{
+ ASSERT(m_layerType == LayerTypeShapeLayer);
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ return Path(CGPathCreateMutableCopy([(CAShapeLayer *)m_layer path]));
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void PlatformCALayerCocoa::setShapePath(const Path& path)
+{
+ ASSERT(m_layerType == LayerTypeShapeLayer);
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [(CAShapeLayer *)m_layer setPath:path.platformPath()];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+
+bool PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange() const
+{
+ return m_customAppearance == GraphicsLayer::ScrollingShadow;
+}
+
+void PlatformCALayerCocoa::updateCustomAppearance(GraphicsLayer::CustomAppearance appearance)
+{
+ if (m_customAppearance == appearance)
+ return;
+
+ m_customAppearance = appearance;
+
+#if ENABLE(RUBBER_BANDING)
+ switch (appearance) {
+ case GraphicsLayer::NoCustomAppearance:
+ case GraphicsLayer::LightBackdropAppearance:
+ case GraphicsLayer::DarkBackdropAppearance:
+ ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer());
+ ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer());
+ break;
+ case GraphicsLayer::ScrollingOverhang:
+ ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer());
+ break;
+ case GraphicsLayer::ScrollingShadow:
+ ScrollbarThemeMac::setUpOverhangAreaShadow(platformLayer());
+ break;
+ }
+#endif
+}
+
+TiledBacking* PlatformCALayerCocoa::tiledBacking()
+{
+ if (!usesTiledBackingLayer())
+ return nullptr;
+
+ WebTiledBackingLayer *tiledBackingLayer = static_cast<WebTiledBackingLayer *>(m_layer.get());
+ return [tiledBackingLayer tiledBacking];
+}
+
+#if PLATFORM(IOS)
+bool PlatformCALayer::isWebLayer()
+{
+ BOOL result = NO;
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ result = [m_layer isKindOfClass:[WebLayer self]];
+ END_BLOCK_OBJC_EXCEPTIONS
+ return result;
+}
+
+void PlatformCALayer::setBoundsOnMainThread(CGRect bounds)
+{
+ CALayer *layer = m_layer.get();
+ dispatch_async(dispatch_get_main_queue(), ^{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [layer setBounds:bounds];
+ END_BLOCK_OBJC_EXCEPTIONS
+ });
+}
+
+void PlatformCALayer::setPositionOnMainThread(CGPoint position)
+{
+ CALayer *layer = m_layer.get();
+ dispatch_async(dispatch_get_main_queue(), ^{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [layer setPosition:position];
+ END_BLOCK_OBJC_EXCEPTIONS
+ });
+}
+
+void PlatformCALayer::setAnchorPointOnMainThread(FloatPoint3D value)
+{
+ CALayer *layer = m_layer.get();
+ dispatch_async(dispatch_get_main_queue(), ^{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [layer setAnchorPoint:CGPointMake(value.x(), value.y())];
+ [layer setAnchorPointZ:value.z()];
+ END_BLOCK_OBJC_EXCEPTIONS
+ });
+}
+
+void PlatformCALayer::setTileSize(const IntSize& tileSize)
+{
+ if (m_layerType != LayerTypeWebTiledLayer)
+ return;
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ [static_cast<WebTiledLayer*>(m_layer.get()) setTileSize:tileSize];
+ END_BLOCK_OBJC_EXCEPTIONS
+}
+#endif // PLATFORM(IOS)
+
+PlatformCALayer::RepaintRectList PlatformCALayer::collectRectsToPaint(CGContextRef context, PlatformCALayer* platformCALayer)
+{
+ __block double totalRectArea = 0;
+ __block unsigned rectCount = 0;
+ __block RepaintRectList dirtyRects;
+
+ platformCALayer->enumerateRectsBeingDrawn(context, ^(CGRect rect) {
+ if (++rectCount > webLayerMaxRectsToPaint)
+ return;
+
+ totalRectArea += rect.size.width * rect.size.height;
+ dirtyRects.append(rect);
+ });
+
+ FloatRect clipBounds = CGContextGetClipBoundingBox(context);
+ double clipArea = clipBounds.width() * clipBounds.height();
+
+ if (rectCount >= webLayerMaxRectsToPaint || totalRectArea >= clipArea * webLayerWastedSpaceThreshold) {
+ dirtyRects.clear();
+ dirtyRects.append(clipBounds);
+ }
+
+ return dirtyRects;
+}
+
+void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList& dirtyRects)
+{
+ WebCore::PlatformCALayerClient* layerContents = platformCALayer->owner();
+ if (!layerContents)
+ return;
+
+#if PLATFORM(IOS)
+ WKSetCurrentGraphicsContext(context);
+#endif
+
+ CGContextSaveGState(context);
+
+ // We never use CompositingCoordinatesBottomUp on Mac.
+ ASSERT(layerContents->platformCALayerContentsOrientation() == GraphicsLayer::CompositingCoordinatesTopDown);
+
+#if PLATFORM(IOS)
+ FontAntialiasingStateSaver fontAntialiasingState(context, [platformCALayer->platformLayer() isOpaque]);
+ fontAntialiasingState.setup([WAKWindow hasLandscapeOrientation]);
+#else
+ [NSGraphicsContext saveGraphicsState];
+
+ // Set up an NSGraphicsContext for the context, so that parts of AppKit that rely on
+ // the current NSGraphicsContext (e.g. NSCell drawing) get the right one.
+ NSGraphicsContext* layerContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:YES];
+ [NSGraphicsContext setCurrentContext:layerContext];
+#endif
+
+ GraphicsContext graphicsContext(context);
+ graphicsContext.setIsCALayerContext(true);
+ graphicsContext.setIsAcceleratedContext(platformCALayer->acceleratesDrawing());
+
+ if (!layerContents->platformCALayerContentsOpaque()) {
+ // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
+ graphicsContext.setShouldSmoothFonts(false);
+ graphicsContext.setAntialiasedFontDilationEnabled(true);
+ }
+
+#if PLATFORM(MAC)
+ // It's important to get the clip from the context, because it may be significantly
+ // smaller than the layer bounds (e.g. tiled layers)
+ ThemeMac::setFocusRingClipRect(CGContextGetClipBoundingBox(context));
+#endif
+
+ for (const auto& rect : dirtyRects) {
+ GraphicsContextStateSaver stateSaver(graphicsContext);
+ graphicsContext.clip(rect);
+
+ layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect);
+ }
+
+#if PLATFORM(IOS)
+ fontAntialiasingState.restore();
+#else
+ ThemeMac::setFocusRingClipRect(FloatRect());
+
+ [NSGraphicsContext restoreGraphicsState];
+#endif
+
+ // Re-fetch the layer owner, since <rdar://problem/9125151> indicates that it might have been destroyed during painting.
+ layerContents = platformCALayer->owner();
+ ASSERT(layerContents);
+
+ CGContextRestoreGState(context);
+
+ // Always update the repaint count so that it's accurate even if the count itself is not shown. This will be useful
+ // for the Web Inspector feeding this information through the LayerTreeAgent.
+ int repaintCount = layerContents->platformCALayerIncrementRepaintCount(platformCALayer);
+
+ if (!platformCALayer->usesTiledBackingLayer() && layerContents && layerContents->platformCALayerShowRepaintCounter(platformCALayer))
+ drawRepaintIndicator(context, platformCALayer, repaintCount, nullptr);
+}
+
+CGRect PlatformCALayer::frameForLayer(const PlatformLayer* tileLayer)
+{
+ return [tileLayer frame];
+}
+
+PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
+{
+ return PlatformCALayerCocoa::create(layerType, client);
+}
+
+void PlatformCALayerCocoa::enumerateRectsBeingDrawn(CGContextRef context, void (^block)(CGRect))
+{
+ wkCALayerEnumerateRectsBeingDrawnWithBlock(m_layer.get(), context, block);
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaWebTiledBackingLayerhfromrev185855trunkSourceWebCoreplatformgraphicscamacWebTiledBackingLayerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebTiledBackingLayer_h
+#define WebTiledBackingLayer_h
+
+#import <QuartzCore/QuartzCore.h>
+
+namespace WebCore {
+class IntRect;
+class PlatformCALayer;
+class TileController;
+class TiledBacking;
+}
+
+@interface WebTiledBackingLayer : CALayer {
+ std::unique_ptr<WebCore::TileController> _tileController;
+}
+
+- (WebCore::TileController*)createTileController:(WebCore::PlatformCALayer*)rootLayer;
+- (WebCore::TiledBacking*)tiledBacking;
+- (void)invalidate;
+
+@end
+
+#endif // WebTiledBackingLayer_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaWebTiledBackingLayerh"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaWebTiledBackingLayermmfromrev185855trunkSourceWebCoreplatformgraphicscamacWebTiledBackingLayermm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.mm (from rev 185855, trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm) (0 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebTiledBackingLayer.h"
+
+#import "IntRect.h"
+#import "TileController.h"
+#import <wtf/MainThread.h>
+
+using namespace WebCore;
+
+@implementation WebTiledBackingLayer
+
+- (id)init
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+#ifndef NDEBUG
+ [self setName:@"WebTiledBackingLayer"];
+#endif
+ return self;
+}
+
+- (void)dealloc
+{
+ ASSERT(!_tileController);
+
+ [super dealloc];
+}
+
+- (id)initWithLayer:(id)layer
+{
+ UNUSED_PARAM(layer);
+
+ ASSERT_NOT_REACHED();
+ return nil;
+}
+
+- (TileController*)createTileController:(PlatformCALayer*)rootLayer
+{
+ ASSERT(!_tileController);
+ _tileController = std::make_unique<WebCore::TileController>(rootLayer);
+ return _tileController.get();
+}
+
+- (id<CAAction>)actionForKey:(NSString *)key
+{
+ UNUSED_PARAM(key);
+
+ // Disable all animations.
+ return nil;
+}
+
+- (void)setBounds:(CGRect)bounds
+{
+ [super setBounds:bounds];
+
+ _tileController->tileCacheLayerBoundsChanged();
+}
+
+- (void)setOpaque:(BOOL)opaque
+{
+ _tileController->setTilesOpaque(opaque);
+}
+
+- (BOOL)isOpaque
+{
+ return _tileController ? _tileController->tilesAreOpaque() : NO;
+}
+
+- (void)setNeedsDisplay
+{
+ _tileController->setNeedsDisplay();
+}
+
+- (void)setNeedsDisplayInRect:(CGRect)rect
+{
+ _tileController->setNeedsDisplayInRect(enclosingIntRect(rect));
+}
+
+- (void)setAcceleratesDrawing:(BOOL)acceleratesDrawing
+{
+ _tileController->setAcceleratesDrawing(acceleratesDrawing);
+}
+
+- (BOOL)acceleratesDrawing
+{
+ return _tileController ? _tileController->acceleratesDrawing() : NO;
+}
+
+- (void)setContentsScale:(CGFloat)contentsScale
+{
+ _tileController->setContentsScale(contentsScale);
+}
+
+- (CGFloat)contentsScale
+{
+ return _tileController ? _tileController->contentsScale() : 1;
+}
+
+- (WebCore::TiledBacking*)tiledBacking
+{
+ return _tileController.get();
+}
+
+- (void)invalidate
+{
+ ASSERT(isMainThread());
+ ASSERT(_tileController);
+ _tileController = nullptr;
+}
+
+- (void)setBorderColor:(CGColorRef)borderColor
+{
+ _tileController->setTileDebugBorderColor(Color(borderColor));
+}
+
+- (void)setBorderWidth:(CGFloat)borderWidth
+{
+ // Tiles adjoin, so halve the border width.
+ _tileController->setTileDebugBorderWidth(borderWidth / 2);
+}
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacLayerFlushSchedulerMaccpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "LayerFlushScheduler.h"
-
-#include <wtf/AutodrainedPool.h>
-
-#if PLATFORM(IOS)
-#include "RuntimeApplicationChecksIOS.h"
-#include <CoreFoundation/CFBundle.h>
-#include <WebCore/WebCoreThread.h>
-#endif
-
-namespace WebCore {
-
-static const CFIndex layerFlushRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
-
-static CFRunLoopRef currentRunLoop()
-{
-#if PLATFORM(IOS)
- // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
- // observer is added to the main run loop <rdar://problem/9798550>. However, for responsiveness,
- // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
- // crash are especially troublesome for iBooks, we never allow the observer to be added to the
- // main run loop in iBooks.
- if (applicationIsIBooksOnIOS())
- return WebThreadRunLoop();
-#endif
- return CFRunLoopGetCurrent();
-}
-
-LayerFlushScheduler::LayerFlushScheduler(LayerFlushSchedulerClient* client)
- : m_isSuspended(false)
- , m_client(client)
-{
- ASSERT_ARG(client, client);
-
- m_runLoopObserver = RunLoopObserver::create(layerFlushRunLoopOrder, [this]() {
- if (this->isSuspended())
- return;
- this->layerFlushCallback();
- });
-}
-
-LayerFlushScheduler::~LayerFlushScheduler()
-{
-}
-
-void LayerFlushScheduler::layerFlushCallback()
-{
- ASSERT(!m_isSuspended);
-
- AutodrainedPool pool;
- if (m_client->flushLayers())
- invalidate();
-}
-
-void LayerFlushScheduler::schedule()
-{
- if (m_isSuspended)
- return;
-
- m_runLoopObserver->schedule(currentRunLoop());
-}
-
-void LayerFlushScheduler::invalidate()
-{
- m_runLoopObserver->invalidate();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMach"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,138 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PlatformCAAnimationMac_h
-#define PlatformCAAnimationMac_h
-
-#include "PlatformCAAnimation.h"
-
-#include <wtf/RetainPtr.h>
-
-OBJC_CLASS CAMediaTimingFunction;
-OBJC_CLASS CAAnimation;
-OBJC_CLASS CAPropertyAnimation;
-OBJC_CLASS NSString;
-
-typedef CAPropertyAnimation* PlatformAnimationRef;
-
-namespace WebCore {
-
-WEBCORE_EXPORT NSString* toCAFillModeType(PlatformCAAnimation::FillModeType);
-WEBCORE_EXPORT NSString* toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType);
-WEBCORE_EXPORT CAMediaTimingFunction* toCAMediaTimingFunction(const TimingFunction*, bool reverse);
-
-bool hasExplicitBeginTime(CAAnimation *);
-void setHasExplicitBeginTime(CAAnimation *, bool);
-
-class PlatformCAAnimationMac final : public PlatformCAAnimation {
-public:
- static PassRefPtr<PlatformCAAnimation> create(AnimationType, const String& keyPath);
- WEBCORE_EXPORT static PassRefPtr<PlatformCAAnimation> create(PlatformAnimationRef);
-
- virtual ~PlatformCAAnimationMac();
-
- virtual bool isPlatformCAAnimationMac() const override { return true; }
-
- virtual PassRefPtr<PlatformCAAnimation> copy() const override;
-
- PlatformAnimationRef platformAnimation() const;
-
- virtual String keyPath() const override;
-
- virtual CFTimeInterval beginTime() const override;
- virtual void setBeginTime(CFTimeInterval) override;
-
- virtual CFTimeInterval duration() const override;
- virtual void setDuration(CFTimeInterval) override;
-
- virtual float speed() const override;
- virtual void setSpeed(float) override;
-
- virtual CFTimeInterval timeOffset() const override;
- virtual void setTimeOffset(CFTimeInterval) override;
-
- virtual float repeatCount() const override;
- virtual void setRepeatCount(float) override;
-
- virtual bool autoreverses() const override;
- virtual void setAutoreverses(bool) override;
-
- virtual FillModeType fillMode() const override;
- virtual void setFillMode(FillModeType) override;
-
- virtual void setTimingFunction(const TimingFunction*, bool reverse = false) override;
- void copyTimingFunctionFrom(const PlatformCAAnimation&) override;
-
- virtual bool isRemovedOnCompletion() const override;
- virtual void setRemovedOnCompletion(bool) override;
-
- virtual bool isAdditive() const override;
- virtual void setAdditive(bool) override;
-
- virtual ValueFunctionType valueFunction() const override;
- virtual void setValueFunction(ValueFunctionType) override;
-
- // Basic-animation properties.
- virtual void setFromValue(float) override;
- virtual void setFromValue(const WebCore::TransformationMatrix&) override;
- virtual void setFromValue(const FloatPoint3D&) override;
- virtual void setFromValue(const WebCore::Color&) override;
- virtual void setFromValue(const FilterOperation*, int internalFilterPropertyIndex) override;
- virtual void copyFromValueFrom(const PlatformCAAnimation&) override;
-
- virtual void setToValue(float) override;
- virtual void setToValue(const WebCore::TransformationMatrix&) override;
- virtual void setToValue(const FloatPoint3D&) override;
- virtual void setToValue(const WebCore::Color&) override;
- virtual void setToValue(const FilterOperation*, int internalFilterPropertyIndex) override;
- virtual void copyToValueFrom(const PlatformCAAnimation&) override;
-
- // Keyframe-animation properties.
- virtual void setValues(const Vector<float>&) override;
- virtual void setValues(const Vector<WebCore::TransformationMatrix>&) override;
- virtual void setValues(const Vector<FloatPoint3D>&) override;
- virtual void setValues(const Vector<WebCore::Color>&) override;
- virtual void setValues(const Vector<RefPtr<FilterOperation>>&, int internalFilterPropertyIndex) override;
- virtual void copyValuesFrom(const PlatformCAAnimation&) override;
-
- virtual void setKeyTimes(const Vector<float>&) override;
- virtual void copyKeyTimesFrom(const PlatformCAAnimation&) override;
-
- virtual void setTimingFunctions(const Vector<const TimingFunction*>&, bool reverse = false) override;
- virtual void copyTimingFunctionsFrom(const PlatformCAAnimation&) override;
-
-protected:
- PlatformCAAnimationMac(AnimationType, const String& keyPath);
- PlatformCAAnimationMac(PlatformAnimationRef);
-
-private:
- RetainPtr<CAPropertyAnimation> m_animation;
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_CAANIMATION(WebCore::PlatformCAAnimationMac, isPlatformCAAnimationMac())
-
-#endif // PlatformCAAnimationMac_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCAAnimationMacmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,578 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#import "PlatformCAAnimationMac.h"
-
-#import "FloatConversion.h"
-#import "PlatformCAFilters.h"
-#import "TimingFunction.h"
-#import <QuartzCore/QuartzCore.h>
-#import <wtf/text/WTFString.h>
-
-using namespace WebCore;
-
-static NSString * const WKExplicitBeginTimeFlag = @"WKPlatformCAAnimationExplicitBeginTimeFlag";
-
-bool WebCore::hasExplicitBeginTime(CAAnimation *animation)
-{
- return [[animation valueForKey:WKExplicitBeginTimeFlag] boolValue];
-}
-
-void WebCore::setHasExplicitBeginTime(CAAnimation *animation, bool value)
-{
- [animation setValue:[NSNumber numberWithBool:value] forKey:WKExplicitBeginTimeFlag];
-}
-
-NSString* WebCore::toCAFillModeType(PlatformCAAnimation::FillModeType type)
-{
- switch (type) {
- case PlatformCAAnimation::NoFillMode:
- case PlatformCAAnimation::Forwards: return kCAFillModeForwards;
- case PlatformCAAnimation::Backwards: return kCAFillModeBackwards;
- case PlatformCAAnimation::Both: return kCAFillModeBoth;
- }
- return @"";
-}
-
-static PlatformCAAnimation::FillModeType fromCAFillModeType(NSString* string)
-{
- if ([string isEqualToString:kCAFillModeBackwards])
- return PlatformCAAnimation::Backwards;
-
- if ([string isEqualToString:kCAFillModeBoth])
- return PlatformCAAnimation::Both;
-
- return PlatformCAAnimation::Forwards;
-}
-
-NSString* WebCore::toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType type)
-{
- switch (type) {
- case PlatformCAAnimation::NoValueFunction: return @"";
- case PlatformCAAnimation::RotateX: return kCAValueFunctionRotateX;
- case PlatformCAAnimation::RotateY: return kCAValueFunctionRotateY;
- case PlatformCAAnimation::RotateZ: return kCAValueFunctionRotateZ;
- case PlatformCAAnimation::ScaleX: return kCAValueFunctionScaleX;
- case PlatformCAAnimation::ScaleY: return kCAValueFunctionScaleY;
- case PlatformCAAnimation::ScaleZ: return kCAValueFunctionScaleZ;
- case PlatformCAAnimation::Scale: return kCAValueFunctionScale;
- case PlatformCAAnimation::TranslateX: return kCAValueFunctionTranslateX;
- case PlatformCAAnimation::TranslateY: return kCAValueFunctionTranslateY;
- case PlatformCAAnimation::TranslateZ: return kCAValueFunctionTranslateZ;
- case PlatformCAAnimation::Translate: return kCAValueFunctionTranslate;
- }
- return @"";
-}
-
-static PlatformCAAnimation::ValueFunctionType fromCAValueFunctionType(NSString* string)
-{
- if ([string isEqualToString:kCAValueFunctionRotateX])
- return PlatformCAAnimation::RotateX;
-
- if ([string isEqualToString:kCAValueFunctionRotateY])
- return PlatformCAAnimation::RotateY;
-
- if ([string isEqualToString:kCAValueFunctionRotateZ])
- return PlatformCAAnimation::RotateZ;
-
- if ([string isEqualToString:kCAValueFunctionScaleX])
- return PlatformCAAnimation::ScaleX;
-
- if ([string isEqualToString:kCAValueFunctionScaleY])
- return PlatformCAAnimation::ScaleY;
-
- if ([string isEqualToString:kCAValueFunctionScaleZ])
- return PlatformCAAnimation::ScaleZ;
-
- if ([string isEqualToString:kCAValueFunctionScale])
- return PlatformCAAnimation::Scale;
-
- if ([string isEqualToString:kCAValueFunctionTranslateX])
- return PlatformCAAnimation::TranslateX;
-
- if ([string isEqualToString:kCAValueFunctionTranslateY])
- return PlatformCAAnimation::TranslateY;
-
- if ([string isEqualToString:kCAValueFunctionTranslateZ])
- return PlatformCAAnimation::TranslateZ;
-
- if ([string isEqualToString:kCAValueFunctionTranslate])
- return PlatformCAAnimation::Translate;
-
- return PlatformCAAnimation::NoValueFunction;
-}
-
-CAMediaTimingFunction* WebCore::toCAMediaTimingFunction(const TimingFunction* timingFunction, bool reverse)
-{
- ASSERT(timingFunction);
- if (timingFunction->isCubicBezierTimingFunction()) {
- RefPtr<CubicBezierTimingFunction> reversed;
- const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(timingFunction);
-
- if (reverse) {
- reversed = ctf->createReversed();
- ctf = reversed.get();
- }
-
- float x1 = static_cast<float>(ctf->x1());
- float y1 = static_cast<float>(ctf->y1());
- float x2 = static_cast<float>(ctf->x2());
- float y2 = static_cast<float>(ctf->y2());
- return [CAMediaTimingFunction functionWithControlPoints: x1 : y1 : x2 : y2];
- }
-
- ASSERT(timingFunction->type() == TimingFunction::LinearFunction);
- return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
-}
-
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationMac::create(AnimationType type, const String& keyPath)
-{
- return adoptRef(new PlatformCAAnimationMac(type, keyPath));
-}
-
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationMac::create(PlatformAnimationRef animation)
-{
- return adoptRef(new PlatformCAAnimationMac(animation));
-}
-
-PlatformCAAnimationMac::PlatformCAAnimationMac(AnimationType type, const String& keyPath)
- : PlatformCAAnimation(type)
-{
- if (type == Basic)
- m_animation = [CABasicAnimation animationWithKeyPath:keyPath];
- else
- m_animation = [CAKeyframeAnimation animationWithKeyPath:keyPath];
-}
-
-PlatformCAAnimationMac::PlatformCAAnimationMac(PlatformAnimationRef animation)
-{
- if ([static_cast<CAAnimation*>(animation) isKindOfClass:[CABasicAnimation class]])
- setType(Basic);
- else if ([static_cast<CAAnimation*>(animation) isKindOfClass:[CAKeyframeAnimation class]])
- setType(Keyframe);
- else {
- ASSERT(0);
- return;
- }
-
- m_animation = static_cast<CAPropertyAnimation*>(animation);
-}
-
-PlatformCAAnimationMac::~PlatformCAAnimationMac()
-{
-}
-
-PassRefPtr<PlatformCAAnimation> PlatformCAAnimationMac::copy() const
-{
- RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath());
-
- animation->setBeginTime(beginTime());
- animation->setDuration(duration());
- animation->setSpeed(speed());
- animation->setTimeOffset(timeOffset());
- animation->setRepeatCount(repeatCount());
- animation->setAutoreverses(autoreverses());
- animation->setFillMode(fillMode());
- animation->setRemovedOnCompletion(isRemovedOnCompletion());
- animation->setAdditive(isAdditive());
- animation->copyTimingFunctionFrom(*this);
- animation->setValueFunction(valueFunction());
-
- setHasExplicitBeginTime(downcast<PlatformCAAnimationMac>(*animation).platformAnimation(), hasExplicitBeginTime(platformAnimation()));
-
- // Copy the specific Basic or Keyframe values.
- if (animationType() == Keyframe) {
- animation->copyValuesFrom(*this);
- animation->copyKeyTimesFrom(*this);
- animation->copyTimingFunctionsFrom(*this);
- } else {
- animation->copyFromValueFrom(*this);
- animation->copyToValueFrom(*this);
- }
-
- return animation;
-}
-
-PlatformAnimationRef PlatformCAAnimationMac::platformAnimation() const
-{
- return m_animation.get();
-}
-
-String PlatformCAAnimationMac::keyPath() const
-{
- return [m_animation keyPath];
-}
-
-CFTimeInterval PlatformCAAnimationMac::beginTime() const
-{
- return [m_animation beginTime];
-}
-
-void PlatformCAAnimationMac::setBeginTime(CFTimeInterval value)
-{
- [m_animation setBeginTime:value];
-
- // Also set a flag to tell us if we've passed in a 0 value.
- // The flag is needed because later beginTime will get changed
- // to the time at which it fired and we need to know whether
- // or not it was 0 to begin with.
- if (value)
- setHasExplicitBeginTime(m_animation.get(), true);
-}
-
-CFTimeInterval PlatformCAAnimationMac::duration() const
-{
- return [m_animation duration];
-}
-
-void PlatformCAAnimationMac::setDuration(CFTimeInterval value)
-{
- [m_animation setDuration:value];
-}
-
-float PlatformCAAnimationMac::speed() const
-{
- return [m_animation speed];
-}
-
-void PlatformCAAnimationMac::setSpeed(float value)
-{
- [m_animation setSpeed:value];
-}
-
-CFTimeInterval PlatformCAAnimationMac::timeOffset() const
-{
- return [m_animation timeOffset];
-}
-
-void PlatformCAAnimationMac::setTimeOffset(CFTimeInterval value)
-{
- [m_animation setTimeOffset:value];
-}
-
-float PlatformCAAnimationMac::repeatCount() const
-{
- return [m_animation repeatCount];
-}
-
-void PlatformCAAnimationMac::setRepeatCount(float value)
-{
- [m_animation setRepeatCount:value];
-}
-
-bool PlatformCAAnimationMac::autoreverses() const
-{
- return [m_animation autoreverses];
-}
-
-void PlatformCAAnimationMac::setAutoreverses(bool value)
-{
- [m_animation setAutoreverses:value];
-}
-
-PlatformCAAnimation::FillModeType PlatformCAAnimationMac::fillMode() const
-{
- return fromCAFillModeType([m_animation fillMode]);
-}
-
-void PlatformCAAnimationMac::setFillMode(FillModeType value)
-{
- [m_animation setFillMode:toCAFillModeType(value)];
-}
-
-void PlatformCAAnimationMac::setTimingFunction(const TimingFunction* value, bool reverse)
-{
- [m_animation setTimingFunction:toCAMediaTimingFunction(value, reverse)];
-}
-
-void PlatformCAAnimationMac::copyTimingFunctionFrom(const PlatformCAAnimation& value)
-{
- [m_animation setTimingFunction:[downcast<PlatformCAAnimationMac>(value).m_animation.get() timingFunction]];
-}
-
-bool PlatformCAAnimationMac::isRemovedOnCompletion() const
-{
- return [m_animation isRemovedOnCompletion];
-}
-
-void PlatformCAAnimationMac::setRemovedOnCompletion(bool value)
-{
- [m_animation setRemovedOnCompletion:value];
-}
-
-bool PlatformCAAnimationMac::isAdditive() const
-{
- return [m_animation isAdditive];
-}
-
-void PlatformCAAnimationMac::setAdditive(bool value)
-{
- [m_animation setAdditive:value];
-}
-
-PlatformCAAnimation::ValueFunctionType PlatformCAAnimationMac::valueFunction() const
-{
- CAValueFunction* vf = [m_animation valueFunction];
- return fromCAValueFunctionType([vf name]);
-}
-
-void PlatformCAAnimationMac::setValueFunction(ValueFunctionType value)
-{
- [m_animation setValueFunction:[CAValueFunction functionWithName:toCAValueFunctionType(value)]];
-}
-
-void PlatformCAAnimationMac::setFromValue(float value)
-{
- if (animationType() != Basic)
- return;
- [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[NSNumber numberWithDouble:value]];
-}
-
-void PlatformCAAnimationMac::setFromValue(const WebCore::TransformationMatrix& value)
-{
- if (animationType() != Basic)
- return;
-
- [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[NSValue valueWithCATransform3D:value]];
-}
-
-void PlatformCAAnimationMac::setFromValue(const FloatPoint3D& value)
-{
- if (animationType() != Basic)
- return;
-
- NSArray* array = [NSArray arrayWithObjects:
- [NSNumber numberWithDouble:value.x()],
- [NSNumber numberWithDouble:value.y()],
- [NSNumber numberWithDouble:value.z()],
- nil];
- [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:array];
-}
-
-void PlatformCAAnimationMac::setFromValue(const WebCore::Color& value)
-{
- if (animationType() != Basic)
- return;
-
- NSArray* array = [NSArray arrayWithObjects:
- [NSNumber numberWithDouble:value.red()],
- [NSNumber numberWithDouble:value.green()],
- [NSNumber numberWithDouble:value.blue()],
- [NSNumber numberWithDouble:value.alpha()],
- nil];
- [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:array];
-}
-
-void PlatformCAAnimationMac::setFromValue(const FilterOperation* operation, int internalFilterPropertyIndex)
-{
- RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(operation, internalFilterPropertyIndex);
- [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:value.get()];
-}
-
-void PlatformCAAnimationMac::copyFromValueFrom(const PlatformCAAnimation& value)
-{
- if (animationType() != Basic || value.animationType() != Basic)
- return;
-
- CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>(downcast<PlatformCAAnimationMac>(value).m_animation.get());
- [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[otherAnimation fromValue]];
-}
-
-void PlatformCAAnimationMac::setToValue(float value)
-{
- if (animationType() != Basic)
- return;
- [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[NSNumber numberWithDouble:value]];
-}
-
-void PlatformCAAnimationMac::setToValue(const WebCore::TransformationMatrix& value)
-{
- if (animationType() != Basic)
- return;
-
- [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[NSValue valueWithCATransform3D:value]];
-}
-
-void PlatformCAAnimationMac::setToValue(const FloatPoint3D& value)
-{
- if (animationType() != Basic)
- return;
-
- NSArray* array = [NSArray arrayWithObjects:
- [NSNumber numberWithDouble:value.x()],
- [NSNumber numberWithDouble:value.y()],
- [NSNumber numberWithDouble:value.z()],
- nil];
- [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:array];
-}
-
-void PlatformCAAnimationMac::setToValue(const WebCore::Color& value)
-{
- if (animationType() != Basic)
- return;
-
- NSArray* array = [NSArray arrayWithObjects:
- [NSNumber numberWithDouble:value.red()],
- [NSNumber numberWithDouble:value.green()],
- [NSNumber numberWithDouble:value.blue()],
- [NSNumber numberWithDouble:value.alpha()],
- nil];
- [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:array];
-}
-
-void PlatformCAAnimationMac::setToValue(const FilterOperation* operation, int internalFilterPropertyIndex)
-{
- RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(operation, internalFilterPropertyIndex);
- [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:value.get()];
-}
-
-void PlatformCAAnimationMac::copyToValueFrom(const PlatformCAAnimation& value)
-{
- if (animationType() != Basic || value.animationType() != Basic)
- return;
-
- CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>(downcast<PlatformCAAnimationMac>(value).m_animation.get());
- [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[otherAnimation toValue]];
-}
-
-
-// Keyframe-animation properties.
-void PlatformCAAnimationMac::setValues(const Vector<float>& value)
-{
- if (animationType() != Keyframe)
- return;
-
- NSMutableArray* array = [NSMutableArray array];
- for (size_t i = 0; i < value.size(); ++i)
- [array addObject:[NSNumber numberWithDouble:value[i]]];
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
-}
-
-void PlatformCAAnimationMac::setValues(const Vector<WebCore::TransformationMatrix>& value)
-{
- if (animationType() != Keyframe)
- return;
-
- NSMutableArray* array = [NSMutableArray array];
-
- for (size_t i = 0; i < value.size(); ++i)
- [array addObject:[NSValue valueWithCATransform3D:value[i]]];
-
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
-}
-
-void PlatformCAAnimationMac::setValues(const Vector<FloatPoint3D>& value)
-{
- if (animationType() != Keyframe)
- return;
-
- NSMutableArray* array = [NSMutableArray array];
-
- for (size_t i = 0; i < value.size(); ++i) {
- NSArray* object = [NSArray arrayWithObjects:
- [NSNumber numberWithDouble:value[i].x()],
- [NSNumber numberWithDouble:value[i].y()],
- [NSNumber numberWithDouble:value[i].z()],
- nil];
- [array addObject:object];
- }
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
-}
-
-void PlatformCAAnimationMac::setValues(const Vector<WebCore::Color>& value)
-{
- if (animationType() != Keyframe)
- return;
-
- NSMutableArray* array = [NSMutableArray array];
-
- for (size_t i = 0; i < value.size(); ++i) {
- NSArray* object = [NSArray arrayWithObjects:
- [NSNumber numberWithDouble:value[i].red()],
- [NSNumber numberWithDouble:value[i].green()],
- [NSNumber numberWithDouble:value[i].blue()],
- [NSNumber numberWithDouble:value[i].alpha()],
- nil];
- [array addObject:object];
- }
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
-}
-
-void PlatformCAAnimationMac::setValues(const Vector<RefPtr<FilterOperation>>& values, int internalFilterPropertyIndex)
-{
- if (animationType() != Keyframe)
- return;
-
- NSMutableArray* array = [NSMutableArray array];
-
- for (size_t i = 0; i < values.size(); ++i) {
- RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(values[i].get(), internalFilterPropertyIndex);
- [array addObject:value.get()];
- }
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:array];
-}
-
-void PlatformCAAnimationMac::copyValuesFrom(const PlatformCAAnimation& value)
-{
- if (animationType() != Keyframe || value.animationType() != Keyframe)
- return;
-
- CAKeyframeAnimation* otherAnimation = static_cast<CAKeyframeAnimation*>(downcast<PlatformCAAnimationMac>(value).m_animation.get());
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:[otherAnimation values]];
-}
-
-void PlatformCAAnimationMac::setKeyTimes(const Vector<float>& value)
-{
- NSMutableArray* array = [NSMutableArray array];
-
- for (size_t i = 0; i < value.size(); ++i)
- [array addObject:[NSNumber numberWithFloat:value[i]]];
-
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setKeyTimes:array];
-}
-
-void PlatformCAAnimationMac::copyKeyTimesFrom(const PlatformCAAnimation& value)
-{
- CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>(downcast<PlatformCAAnimationMac>(value).m_animation.get());
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setKeyTimes:[other keyTimes]];
-}
-
-void PlatformCAAnimationMac::setTimingFunctions(const Vector<const TimingFunction*>& value, bool reverse)
-{
- NSMutableArray* array = [NSMutableArray array];
-
- for (size_t i = 0; i < value.size(); ++i)
- [array addObject:toCAMediaTimingFunction(value[i], reverse)];
-
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setTimingFunctions:array];
-}
-
-void PlatformCAAnimationMac::copyTimingFunctionsFrom(const PlatformCAAnimation& value)
-{
- CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>(downcast<PlatformCAAnimationMac>(value).m_animation.get());
- [static_cast<CAKeyframeAnimation*>(m_animation.get()) setTimingFunctions:[other timingFunctions]];
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,677 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#import "PlatformCAFilters.h"
-#import "BlockExceptions.h"
-#import "FloatConversion.h"
-#import "LengthFunctions.h" // This is a layering violation.
-#import "PlatformCALayerMac.h"
-#import "QuartzCoreSPI.h"
-#import <QuartzCore/QuartzCore.h>
-
-using namespace WebCore;
-
-// FIXME: Should share these values with FilterEffectRenderer::build() (https://bugs.webkit.org/show_bug.cgi?id=76008).
-static const double sepiaFullConstants[3][3] = {
- { 0.393, 0.769, 0.189 },
- { 0.349, 0.686, 0.168 },
- { 0.272, 0.534, 0.131 }
-};
-
-static const double sepiaNoneConstants[3][3] = {
- { 1, 0, 0 },
- { 0, 1, 0 },
- { 0, 0, 1 }
-};
-
-void PlatformCAFilters::setFiltersOnLayer(PlatformLayer* layer, const FilterOperations& filters)
-{
- if (!filters.size()) {
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [layer setFilters:nil];
- // FIXME: this adds shadow properties to the layer even when it had none.
- [layer setShadowOffset:CGSizeZero];
- [layer setShadowColor:nil];
- [layer setShadowRadius:0];
- [layer setShadowOpacity:0];
- END_BLOCK_OBJC_EXCEPTIONS
- return;
- }
-
- // Assume filtersCanBeComposited was called and it returned true.
- ASSERT(PlatformCALayerMac::filtersCanBeComposited(filters));
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
-
- RetainPtr<NSMutableArray> array = adoptNS([[NSMutableArray alloc] init]);
-
- for (unsigned i = 0; i < filters.size(); ++i) {
- String filterName = String::format("filter_%d", i);
- const FilterOperation& filterOperation = *filters.at(i);
- switch (filterOperation.type()) {
- case FilterOperation::DEFAULT:
- ASSERT_NOT_REACHED();
- break;
- case FilterOperation::DROP_SHADOW: {
- // FIXME: For now assume drop shadow is the last filter, put it on the layer.
- // <rdar://problem/10959969> Handle case where drop-shadow is not the last filter.
- const auto& dropShadowOperation = downcast<DropShadowFilterOperation>(filterOperation);
- [layer setShadowOffset:CGSizeMake(dropShadowOperation.x(), dropShadowOperation.y())];
-
- CGFloat components[4];
- dropShadowOperation.color().getRGBA(components[0], components[1], components[2], components[3]);
- RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
- RetainPtr<CGColorRef> color = adoptCF(CGColorCreate(colorSpace.get(), components));
- [layer setShadowColor:color.get()];
- [layer setShadowRadius:dropShadowOperation.stdDeviation()];
- [layer setShadowOpacity:1];
- break;
- }
-#if USE_CA_FILTERS
- case FilterOperation::GRAYSCALE: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMonochrome];
- [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputAmount"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::SEPIA: {
- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
- [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::SATURATE: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorSaturate];
- [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputAmount"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::HUE_ROTATE: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorHueRotate];
- [filter setValue:[NSNumber numberWithFloat:deg2rad(colorMatrixOperation.amount())] forKey:@"inputAngle"];
- [filter setName:@"hueRotate"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::INVERT: {
- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
- [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::OPACITY: {
- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
- [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::BRIGHTNESS: {
- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
- [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::CONTRAST: {
- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation.type(), &filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
- [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::BLUR: {
- const auto& blurOperation = downcast<BlurFilterOperation>(filterOperation);
- CAFilter *filter = [CAFilter filterWithType:kCAFilterGaussianBlur];
- [filter setValue:[NSNumber numberWithFloat:floatValueForLength(blurOperation.stdDeviation(), 0)] forKey:@"inputRadius"];
-#if ENABLE(FILTERS_LEVEL_2)
- if (filters.isUsedForBackdropFilters())
- [filter setValue:[NSNumber numberWithBool:YES] forKey:@"inputNormalizeEdges"];
-#endif
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
-#else
- case FilterOperation::GRAYSCALE: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorMonochrome"];
- [filter setDefaults];
- [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputIntensity"];
- [filter setValue:[CIColor colorWithRed:0.67 green:0.67 blue:0.67] forKey:@"inputColor"]; // Color derived empirically to match zero saturation levels.
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::SEPIA: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
- [filter setDefaults];
-
- double t = colorMatrixOperation.amount();
- t = std::min(std::max(0.0, t), 1.0);
- // FIXME: results don't match the software filter.
- [filter setValue:[CIVector vectorWithX:WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], t)
- Y:WebCore::blend(sepiaNoneConstants[0][1], sepiaFullConstants[0][1], t)
- Z:WebCore::blend(sepiaNoneConstants[0][2], sepiaFullConstants[0][2], t) W:0] forKey:@"inputRVector"];
- [filter setValue:[CIVector vectorWithX:WebCore::blend(sepiaNoneConstants[1][0], sepiaFullConstants[1][0], t)
- Y:WebCore::blend(sepiaNoneConstants[1][1], sepiaFullConstants[1][1], t)
- Z:WebCore::blend(sepiaNoneConstants[1][2], sepiaFullConstants[1][2], t) W:0] forKey:@"inputGVector"];
- [filter setValue:[CIVector vectorWithX:WebCore::blend(sepiaNoneConstants[2][0], sepiaFullConstants[2][0], t)
- Y:WebCore::blend(sepiaNoneConstants[2][1], sepiaFullConstants[2][1], t)
- Z:WebCore::blend(sepiaNoneConstants[2][2], sepiaFullConstants[2][2], t) W:0] forKey:@"inputBVector"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::SATURATE: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorControls"];
- [filter setDefaults];
- [filter setValue:[NSNumber numberWithFloat:colorMatrixOperation.amount()] forKey:@"inputSaturation"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::HUE_ROTATE: {
- const auto& colorMatrixOperation = downcast<BasicColorMatrixFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIHueAdjust"];
- [filter setDefaults];
-
- [filter setValue:[NSNumber numberWithFloat:deg2rad(colorMatrixOperation.amount())] forKey:@"inputAngle"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::INVERT: {
- const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
- [filter setDefaults];
-
- double multiplier = 1 - componentTransferOperation.amount() * 2;
-
- // FIXME: the results of this filter look wrong.
- [filter setValue:[CIVector vectorWithX:multiplier Y:0 Z:0 W:0] forKey:@"inputRVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:multiplier Z:0 W:0] forKey:@"inputGVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:0 Z:multiplier W:0] forKey:@"inputBVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:1] forKey:@"inputAVector"];
- [filter setValue:[CIVector vectorWithX:op->amount() Y:op->amount() Z:op->amount() W:0] forKey:@"inputBiasVector"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::OPACITY: {
- const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
- [filter setDefaults];
-
- [filter setValue:[CIVector vectorWithX:1 Y:0 Z:0 W:0] forKey:@"inputRVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:1 Z:0 W:0] forKey:@"inputGVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:0 Z:1 W:0] forKey:@"inputBVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:componentTransferOperation.amount()] forKey:@"inputAVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:0] forKey:@"inputBiasVector"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::BRIGHTNESS: {
- const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorMatrix"];
- [filter setDefaults];
- double amount = componentTransferOperation.amount();
-
- [filter setValue:[CIVector vectorWithX:amount Y:0 Z:0 W:0] forKey:@"inputRVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:amount Z:0 W:0] forKey:@"inputGVector"];
- [filter setValue:[CIVector vectorWithX:0 Y:0 Z:amount W:0] forKey:@"inputBVector"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::CONTRAST: {
- const auto& componentTransferOperation = downcast<BasicComponentTransferFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIColorControls"];
- [filter setDefaults];
- [filter setValue:[NSNumber numberWithFloat:componentTransferOperation.amount()] forKey:@"inputContrast"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
- case FilterOperation::BLUR: {
- // FIXME: For now we ignore stdDeviationY.
- const auto& blurOperation = downcast<BlurFilterOperation>(filterOperation);
- CIFilter* filter = [CIFilter filterWithName:@"CIGaussianBlur"];
- [filter setDefaults];
- [filter setValue:[NSNumber numberWithFloat:floatValueForLength(blurOperation.stdDeviation(), 0)] forKey:@"inputRadius"];
- [filter setName:filterName];
- [array.get() addObject:filter];
- break;
- }
-#endif
- case FilterOperation::PASSTHROUGH:
- break;
- default:
- ASSERT(0);
- break;
- }
- }
-
- if ([array.get() count] > 0)
- [layer setFilters:array.get()];
-
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-RetainPtr<NSValue> PlatformCAFilters::filterValueForOperation(const FilterOperation* operation, int internalFilterPropertyIndex)
-{
-#if USE_CA_FILTERS
- UNUSED_PARAM(internalFilterPropertyIndex);
-#endif
- FilterOperation::OperationType type = operation->type();
- RetainPtr<id> value;
-
- if (is<DefaultFilterOperation>(*operation)) {
- type = downcast<DefaultFilterOperation>(*operation).representedType();
- operation = nullptr;
- }
-
- switch (type) {
- case FilterOperation::DEFAULT:
- ASSERT_NOT_REACHED();
- break;
- case FilterOperation::GRAYSCALE: {
- // CIFilter: inputIntensity
- // CAFilter: inputAmount
- double amount = 0;
- if (operation)
- amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
-
- value = [NSNumber numberWithDouble:amount];
- break;
- }
- case FilterOperation::SEPIA: {
-#if USE_CA_FILTERS
- // CAFilter: inputColorMatrix
- value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
-#else
- // CIFilter: inputRVector, inputGVector, inputBVector
- double amount = 0;
- if (operation)
- amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
-
- CIVector* rowVector = nullptr;
- switch (internalFilterPropertyIndex) {
- case 0: rowVector = [[CIVector alloc] initWithX:WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], amount)
- Y:WebCore::blend(sepiaNoneConstants[0][1], sepiaFullConstants[0][1], amount)
- Z:WebCore::blend(sepiaNoneConstants[0][2], sepiaFullConstants[0][2], amount) W:0]; break; // inputRVector
- case 1: rowVector = [[CIVector alloc] initWithX:WebCore::blend(sepiaNoneConstants[1][0], sepiaFullConstants[1][0], amount)
- Y:WebCore::blend(sepiaNoneConstants[1][1], sepiaFullConstants[1][1], amount)
- Z:WebCore::blend(sepiaNoneConstants[1][2], sepiaFullConstants[1][2], amount) W:0]; break; // inputGVector
- case 2: rowVector = [[CIVector alloc] initWithX:WebCore::blend(sepiaNoneConstants[2][0], sepiaFullConstants[2][0], amount)
- Y:WebCore::blend(sepiaNoneConstants[2][1], sepiaFullConstants[2][1], amount)
- Z:WebCore::blend(sepiaNoneConstants[2][2], sepiaFullConstants[2][2], amount) W:0]; break; // inputBVector
- }
- value = adoptNS(rowVector);
-#endif
- break;
- }
- case FilterOperation::SATURATE: {
- // CIFilter: inputSaturation
- // CAFilter: inputAmount
- double amount = 1;
- if (operation)
- amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
-
- value = [NSNumber numberWithDouble:amount];
- break;
- }
- case FilterOperation::HUE_ROTATE: {
- // Hue rotate CIFilter: inputAngle
- // Hue rotate CAFilter: inputAngle
- double amount = 0;
- if (operation)
- amount = downcast<BasicColorMatrixFilterOperation>(*operation).amount();
-
- amount = deg2rad(amount);
- value = [NSNumber numberWithDouble:amount];
- break;
- }
- case FilterOperation::INVERT: {
-#if USE_CA_FILTERS
- // CAFilter: inputColorMatrix
- value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
-#else
- // CIFilter: inputRVector, inputGVector, inputBVector, inputBiasVector
- double amount = 0;
- if (operation)
- amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
-
- double multiplier = 1 - amount * 2;
-
- // The color matrix animation for invert does a scale of each color component by a value that goes from
- // 1 (when amount is 0) to -1 (when amount is 1). Then the color values are offset by amount. This has the
- // effect of performing the operation: c' = c * -1 + 1, which inverts the color.
- CIVector* rowVector = 0;
- switch (internalFilterPropertyIndex) {
- case 0: rowVector = [[CIVector alloc] initWithX:multiplier Y:0 Z:0 W:0]; break; // inputRVector
- case 1: rowVector = [[CIVector alloc] initWithX:0 Y:multiplier Z:0 W:0]; break; // inputGVector
- case 2: rowVector = [[CIVector alloc] initWithX:0 Y:0 Z:multiplier W:0]; break; // inputBVector
- case 3: rowVector = [[CIVector alloc] initWithX:amount Y:amount Z:amount W:0]; break; // inputBiasVector
- }
- value = adoptNS(rowVector);
-#endif
- break;
- }
- case FilterOperation::OPACITY: {
-#if USE_CA_FILTERS
- // Opacity CAFilter: inputColorMatrix
- value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
-#else
- // Opacity CIFilter: inputAVector
- double amount = 1;
- if (operation)
- amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
-
- value = adoptNS([[CIVector alloc] initWithX:0 Y:0 Z:0 W:amount]);
-#endif
- break;
- }
-
- case FilterOperation::BRIGHTNESS: {
-#if USE_CA_FILTERS
- // Brightness CAFilter: inputColorMatrix
- value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
-#else
- // Brightness CIFilter: inputColorMatrix
- double amount = 1;
- if (operation)
- amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
-
- CIVector* rowVector = nullptr;
- switch (internalFilterPropertyIndex) {
- case 0: rowVector = [[CIVector alloc] initWithX:amount Y:0 Z:0 W:0]; break; // inputRVector
- case 1: rowVector = [[CIVector alloc] initWithX:0 Y:amount Z:0 W:0]; break; // inputGVector
- case 2: rowVector = [[CIVector alloc] initWithX:0 Y:0 Z:amount W:0]; break; // inputBVector
- }
- value = adoptNS(rowVector);
-#endif
- break;
- }
-
- case FilterOperation::CONTRAST: {
-#if USE_CA_FILTERS
- // Contrast CAFilter: inputColorMatrix
- value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
-#else
- // Contrast CIFilter: inputContrast
- double amount = 1;
- if (operation)
- amount = downcast<BasicComponentTransferFilterOperation>(*operation).amount();
-
- value = [NSNumber numberWithDouble:amount];
-#endif
- break;
- }
- case FilterOperation::BLUR: {
- // CIFilter: inputRadius
- // CAFilter: inputRadius
- double amount = 0;
- if (operation)
- amount = floatValueForLength(downcast<BlurFilterOperation>(*operation).stdDeviation(), 0);
-
- value = [NSNumber numberWithDouble:amount];
- break;
- }
- default:
- break;
- }
-
- return value;
-}
-
-#if USE_CA_FILTERS
-RetainPtr<NSValue> PlatformCAFilters::colorMatrixValueForFilter(FilterOperation::OperationType type, const FilterOperation* filterOperation)
-{
- switch (type) {
- case FilterOperation::SEPIA: {
- double t = filterOperation ? downcast<BasicColorMatrixFilterOperation>(*filterOperation).amount() : 0;
- t = std::min(std::max(0.0, t), 1.0);
- CAColorMatrix colorMatrix = {
- static_cast<float>(WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], t)),
- static_cast<float>(WebCore::blend(sepiaNoneConstants[0][1], sepiaFullConstants[0][1], t)),
- static_cast<float>(WebCore::blend(sepiaNoneConstants[0][2], sepiaFullConstants[0][2], t)), 0, 0,
-
- static_cast<float>(WebCore::blend(sepiaNoneConstants[1][0], sepiaFullConstants[1][0], t)),
- static_cast<float>(WebCore::blend(sepiaNoneConstants[1][1], sepiaFullConstants[1][1], t)),
- static_cast<float>(WebCore::blend(sepiaNoneConstants[1][2], sepiaFullConstants[1][2], t)), 0, 0,
-
- static_cast<float>(WebCore::blend(sepiaNoneConstants[2][0], sepiaFullConstants[2][0], t)),
- static_cast<float>(WebCore::blend(sepiaNoneConstants[2][1], sepiaFullConstants[2][1], t)),
- static_cast<float>(WebCore::blend(sepiaNoneConstants[2][2], sepiaFullConstants[2][2], t)), 0, 0,
- 0, 0, 0, 1, 0
- };
- return [NSValue valueWithCAColorMatrix:colorMatrix];
- }
- case FilterOperation::INVERT: {
- float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(*filterOperation).amount() : 0;
- float multiplier = 1 - amount * 2;
- CAColorMatrix colorMatrix = {
- multiplier, 0, 0, 0, amount,
- 0, multiplier, 0, 0, amount,
- 0, 0, multiplier, 0, amount,
- 0, 0, 0, 1, 0
- };
- return [NSValue valueWithCAColorMatrix:colorMatrix];
- }
- case FilterOperation::OPACITY: {
- float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(filterOperation)->amount() : 1;
- CAColorMatrix colorMatrix = {
- 1, 0, 0, 0, 0,
- 0, 1, 0, 0, 0,
- 0, 0, 1, 0, 0,
- 0, 0, 0, amount, 0
- };
- return [NSValue valueWithCAColorMatrix:colorMatrix];
- }
- case FilterOperation::CONTRAST: {
- float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(filterOperation)->amount() : 1;
- float intercept = -0.5 * amount + 0.5;
- CAColorMatrix colorMatrix = {
- amount, 0, 0, 0, intercept,
- 0, amount, 0, 0, intercept,
- 0, 0, amount, 0, intercept,
- 0, 0, 0, 1, 0
- };
- return [NSValue valueWithCAColorMatrix:colorMatrix];
- }
- case FilterOperation::BRIGHTNESS: {
- float amount = filterOperation ? downcast<BasicComponentTransferFilterOperation>(filterOperation)->amount() : 1;
- CAColorMatrix colorMatrix = {
- amount, 0, 0, 0, 0,
- 0, amount, 0, 0, 0,
- 0, 0, amount, 0, 0,
- 0, 0, 0, 1, 0
- };
- return [NSValue valueWithCAColorMatrix:colorMatrix];
- }
- default:
- ASSERT_NOT_REACHED();
- return 0;
- }
-}
-#endif
-
-void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformLayer* layer, const BlendMode blendMode)
-{
-#if USE_CA_FILTERS
- BEGIN_BLOCK_OBJC_EXCEPTIONS
-
- CAFilter* filter = nil;
-
- switch (blendMode) {
- case BlendModeNormal:
- // No need to set an actual filter object in this case.
- break;
- case BlendModeOverlay:
- filter = [CAFilter filterWithType:kCAFilterOverlayBlendMode];
- break;
- case BlendModeColorDodge:
- filter = [CAFilter filterWithType:kCAFilterColorDodgeBlendMode];
- break;
- case BlendModeColorBurn:
- filter = [CAFilter filterWithType:kCAFilterColorBurnBlendMode];
- break;
- case BlendModeDarken:
- filter = [CAFilter filterWithType:kCAFilterDarkenBlendMode];
- break;
- case BlendModeDifference:
- filter = [CAFilter filterWithType:kCAFilterDifferenceBlendMode];
- break;
- case BlendModeExclusion:
- filter = [CAFilter filterWithType:kCAFilterExclusionBlendMode];
- break;
- case BlendModeHardLight:
- filter = [CAFilter filterWithType:kCAFilterHardLightBlendMode];
- break;
- case BlendModeMultiply:
- filter = [CAFilter filterWithType:kCAFilterMultiplyBlendMode];
- break;
- case BlendModeLighten:
- filter = [CAFilter filterWithType:kCAFilterLightenBlendMode];
- break;
- case BlendModeSoftLight:
- filter = [CAFilter filterWithType:kCAFilterSoftLightBlendMode];
- break;
- case BlendModeScreen:
- filter = [CAFilter filterWithType:kCAFilterScreenBlendMode];
- break;
- case BlendModePlusDarker:
- filter = [CAFilter filterWithType:kCAFilterPlusD];
- break;
- case BlendModePlusLighter:
- filter = [CAFilter filterWithType:kCAFilterPlusL];
- break;
- default:
- ASSERT_NOT_REACHED();
- }
-
- [layer setCompositingFilter:filter];
-
- END_BLOCK_OBJC_EXCEPTIONS
-#else
- UNUSED_PARAM(layer);
- UNUSED_PARAM(blendMode);
-#endif
-}
-
-int PlatformCAFilters::numAnimatedFilterProperties(FilterOperation::OperationType type)
-{
-#if USE_CA_FILTERS
- switch (type) {
- case FilterOperation::GRAYSCALE: return 1;
- case FilterOperation::SEPIA: return 1;
- case FilterOperation::SATURATE: return 1;
- case FilterOperation::HUE_ROTATE: return 1;
- case FilterOperation::INVERT: return 1;
- case FilterOperation::OPACITY: return 1;
- case FilterOperation::BRIGHTNESS: return 1;
- case FilterOperation::CONTRAST: return 1;
- case FilterOperation::BLUR: return 1;
- default: return 0;
- }
-#else
- switch (type) {
- case FilterOperation::GRAYSCALE: return 1;
- case FilterOperation::SEPIA: return 3;
- case FilterOperation::SATURATE: return 1;
- case FilterOperation::HUE_ROTATE: return 1;
- case FilterOperation::INVERT: return 4;
- case FilterOperation::OPACITY: return 1;
- case FilterOperation::BRIGHTNESS: return 3;
- case FilterOperation::CONTRAST: return 1;
- case FilterOperation::BLUR: return 1;
- default: return 0;
- }
-#endif
-}
-
-const char* PlatformCAFilters::animatedFilterPropertyName(FilterOperation::OperationType type, int internalFilterPropertyIndex)
-{
-#if USE_CA_FILTERS
- UNUSED_PARAM(internalFilterPropertyIndex);
- switch (type) {
- case FilterOperation::GRAYSCALE: return "inputAmount";
- case FilterOperation::SEPIA:return "inputColorMatrix";
- case FilterOperation::SATURATE: return "inputAmount";
- case FilterOperation::HUE_ROTATE: return "inputAngle";
- case FilterOperation::INVERT: return "inputColorMatrix";
- case FilterOperation::OPACITY: return "inputColorMatrix";
- case FilterOperation::BRIGHTNESS: return "inputColorMatrix";
- case FilterOperation::CONTRAST: return "inputColorMatrix";
- case FilterOperation::BLUR: return "inputRadius";
- default: return "";
- }
-#else
- switch (type) {
- case FilterOperation::GRAYSCALE: return "inputIntensity";
- case FilterOperation::SEPIA:
- case FilterOperation::BRIGHTNESS:
- switch (internalFilterPropertyIndex) {
- case 0: return "inputRVector";
- case 1: return "inputGVector";
- case 2: return "inputBVector";
- default: return "";
- }
- case FilterOperation::SATURATE: return "inputSaturation";
- case FilterOperation::HUE_ROTATE: return "inputAngle";
- case FilterOperation::INVERT:
- switch (internalFilterPropertyIndex) {
- case 0: return "inputRVector";
- case 1: return "inputGVector";
- case 2: return "inputBVector";
- case 3: return "inputBiasVector";
- default: return "";
- }
- case FilterOperation::OPACITY: return "inputAVector";
- case FilterOperation::CONTRAST: return "inputContrast";
- case FilterOperation::BLUR: return "inputRadius";
- default: return "";
- }
-#endif
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,185 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PlatformCALayerMac_h
-#define PlatformCALayerMac_h
-
-#include "PlatformCALayer.h"
-
-OBJC_CLASS NSObject;
-
-namespace WebCore {
-
-class PlatformCALayerMac final : public PlatformCALayer {
-public:
- static PassRefPtr<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
-
- // This function passes the layer as a void* rather than a PlatformLayer because PlatformLayer
- // is defined differently for Obj C and C++. This allows callers from both languages.
- static PassRefPtr<PlatformCALayer> create(void* platformLayer, PlatformCALayerClient*);
-
- WEBCORE_EXPORT static LayerType layerTypeForPlatformLayer(PlatformLayer*);
-
- ~PlatformCALayerMac();
-
- virtual void setOwner(PlatformCALayerClient*) override;
-
- virtual void setNeedsDisplay() override;
- virtual void setNeedsDisplayInRect(const FloatRect& dirtyRect) override;
-
- virtual void copyContentsFromLayer(PlatformCALayer*) override;
-
- virtual PlatformCALayer* superlayer() const override;
- virtual void removeFromSuperlayer() override;
- virtual void setSublayers(const PlatformCALayerList&) override;
- virtual void removeAllSublayers() override;
- virtual void appendSublayer(PlatformCALayer&) override;
- virtual void insertSublayer(PlatformCALayer&, size_t index) override;
- virtual void replaceSublayer(PlatformCALayer& reference, PlatformCALayer&) override;
- virtual const PlatformCALayerList* customSublayers() const override { return m_customSublayers.get(); }
- virtual void adoptSublayers(PlatformCALayer& source) override;
-
- virtual void addAnimationForKey(const String& key, PlatformCAAnimation&) override;
- virtual void removeAnimationForKey(const String& key) override;
- virtual PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
- virtual void animationStarted(const String& key, CFTimeInterval beginTime) override;
- virtual void animationEnded(const String& key) override;
-
- virtual void setMask(PlatformCALayer*) override;
-
- virtual bool isOpaque() const override;
- virtual void setOpaque(bool) override;
-
- virtual FloatRect bounds() const override;
- virtual void setBounds(const FloatRect&) override;
-
- virtual FloatPoint3D position() const override;
- virtual void setPosition(const FloatPoint3D&) override;
-
- virtual FloatPoint3D anchorPoint() const override;
- virtual void setAnchorPoint(const FloatPoint3D&) override;
-
- virtual TransformationMatrix transform() const override;
- virtual void setTransform(const TransformationMatrix&) override;
-
- virtual TransformationMatrix sublayerTransform() const override;
- virtual void setSublayerTransform(const TransformationMatrix&) override;
-
- virtual void setHidden(bool) override;
-
- virtual void setBackingStoreAttached(bool) override;
- virtual bool backingStoreAttached() const override;
-
- WEBCORE_EXPORT virtual void setGeometryFlipped(bool) override;
-
- virtual bool isDoubleSided() const override;
- virtual void setDoubleSided(bool) override;
-
- virtual bool masksToBounds() const override;
- virtual void setMasksToBounds(bool) override;
-
- virtual bool acceleratesDrawing() const override;
- virtual void setAcceleratesDrawing(bool) override;
-
- virtual CFTypeRef contents() const override;
- virtual void setContents(CFTypeRef) override;
-
- virtual void setContentsRect(const FloatRect&) override;
-
- virtual void setMinificationFilter(FilterType) override;
- virtual void setMagnificationFilter(FilterType) override;
-
- virtual Color backgroundColor() const override;
- virtual void setBackgroundColor(const Color&) override;
-
- virtual void setBorderWidth(float) override;
-
- virtual void setBorderColor(const Color&) override;
-
- virtual float opacity() const override;
- virtual void setOpacity(float) override;
- virtual void setFilters(const FilterOperations&) override;
- WEBCORE_EXPORT static bool filtersCanBeComposited(const FilterOperations&);
- virtual void copyFiltersFrom(const PlatformCALayer&) override;
-
-#if ENABLE(CSS_COMPOSITING)
- virtual void setBlendMode(BlendMode) override;
-#endif
-
- virtual void setName(const String&) override;
-
- virtual void setSpeed(float) override;
-
- virtual void setTimeOffset(CFTimeInterval) override;
-
- virtual float contentsScale() const override;
- virtual void setContentsScale(float) override;
-
- virtual float cornerRadius() const override;
- virtual void setCornerRadius(float) override;
-
- virtual void setEdgeAntialiasingMask(unsigned) override;
-
- virtual FloatRoundedRect shapeRoundedRect() const override;
- virtual void setShapeRoundedRect(const FloatRoundedRect&) override;
-
- virtual Path shapePath() const override;
- virtual void setShapePath(const Path&) override;
-
- virtual WindRule shapeWindRule() const override;
- virtual void setShapeWindRule(WindRule) override;
-
- virtual GraphicsLayer::CustomAppearance customAppearance() const override { return m_customAppearance; }
- virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) override;
-
- virtual TiledBacking* tiledBacking() override;
-
- virtual PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
-
- virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
-
- virtual void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
-
-private:
- PlatformCALayerMac(LayerType, PlatformCALayerClient* owner);
- PlatformCALayerMac(PlatformLayer*, PlatformCALayerClient* owner);
-
- void commonInit();
-
- virtual bool isPlatformCALayerMac() const override { return true; }
-
- bool requiresCustomAppearanceUpdateOnBoundsChange() const;
-
- RetainPtr<NSObject> m_delegate;
- std::unique_ptr<PlatformCALayerList> m_customSublayers;
- GraphicsLayer::CustomAppearance m_customAppearance;
- std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect;
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebCore::PlatformCALayerMac, isPlatformCALayerMac())
-
-#endif // PlatformCALayerMac_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,1110 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#import "PlatformCALayerMac.h"
-
-#import "AnimationUtilities.h"
-#import "BlockExceptions.h"
-#import "FontAntialiasingStateSaver.h"
-#import "GraphicsContext.h"
-#import "GraphicsLayerCA.h"
-#import "LengthFunctions.h"
-#import "PlatformCAAnimationMac.h"
-#import "PlatformCAFilters.h"
-#import "QuartzCoreSPI.h"
-#import "ScrollbarThemeMac.h"
-#import "SoftLinking.h"
-#import "TiledBacking.h"
-#import "TileController.h"
-#import "WebActionDisablingCALayerDelegate.h"
-#import "WebCoreCALayerExtras.h"
-#import "WebLayer.h"
-#import "WebGLLayer.h"
-#import "WebTiledBackingLayer.h"
-#import <objc/objc-auto.h>
-#import <objc/runtime.h>
-#import <AVFoundation/AVFoundation.h>
-#import <QuartzCore/QuartzCore.h>
-#import <wtf/CurrentTime.h>
-#import <wtf/RetainPtr.h>
-
-#if PLATFORM(IOS)
-#import "WAKWindow.h"
-#import "WKGraphics.h"
-#import "WebCoreThread.h"
-#import "WebTiledLayer.h"
-#else
-#import "ThemeMac.h"
-#endif
-
-#if ENABLE(FILTERS_LEVEL_2)
-@interface CABackdropLayer : CALayer
-@end
-#endif
-
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
-
-using namespace WebCore;
-
-PassRefPtr<PlatformCALayer> PlatformCALayerMac::create(LayerType layerType, PlatformCALayerClient* owner)
-{
- return adoptRef(new PlatformCALayerMac(layerType, owner));
-}
-
-PassRefPtr<PlatformCALayer> PlatformCALayerMac::create(void* platformLayer, PlatformCALayerClient* owner)
-{
- return adoptRef(new PlatformCALayerMac(static_cast<PlatformLayer*>(platformLayer), owner));
-}
-
-static NSString * const platformCALayerPointer = @"WKPlatformCALayer";
-PlatformCALayer* PlatformCALayer::platformCALayer(void* platformLayer)
-{
- if (!platformLayer)
- return 0;
-
- // Pointer to PlatformCALayer is kept in a key of the CALayer
- PlatformCALayer* platformCALayer = nil;
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- platformCALayer = static_cast<PlatformCALayer*>([[static_cast<CALayer*>(platformLayer) valueForKey:platformCALayerPointer] pointerValue]);
- END_BLOCK_OBJC_EXCEPTIONS
- return platformCALayer;
-}
-
-static double mediaTimeToCurrentTime(CFTimeInterval t)
-{
- return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
-}
-
-// Delegate for animationDidStart callback
-@interface WebAnimationDelegate : NSObject {
- PlatformCALayer* m_owner;
-}
-
-- (void)animationDidStart:(CAAnimation *)anim;
-- (void)setOwner:(PlatformCALayer*)owner;
-
-@end
-
-@implementation WebAnimationDelegate
-
-- (void)animationDidStart:(CAAnimation *)animation
-{
-#if PLATFORM(IOS)
- WebThreadLock();
-#endif
- if (!m_owner)
- return;
-
- CFTimeInterval startTime;
- if (hasExplicitBeginTime(animation)) {
- // We don't know what time CA used to commit the animation, so just use the current time
- // (even though this will be slightly off).
- startTime = mediaTimeToCurrentTime(CACurrentMediaTime());
- } else
- startTime = mediaTimeToCurrentTime([animation beginTime]);
-
- CALayer *layer = m_owner->platformLayer();
-
- String animationKey;
- for (NSString *key in [layer animationKeys]) {
- if ([layer animationForKey:key] == animation) {
- animationKey = key;
- break;
- }
- }
-
- if (!animationKey.isEmpty())
- m_owner->animationStarted(animationKey, startTime);
-}
-
-- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
-{
-#if PLATFORM(IOS)
- WebThreadLock();
-#endif
- UNUSED_PARAM(finished);
-
- if (!m_owner)
- return;
-
- CALayer *layer = m_owner->platformLayer();
-
- String animationKey;
- for (NSString *key in [layer animationKeys]) {
- if ([layer animationForKey:key] == animation) {
- animationKey = key;
- break;
- }
- }
-
- if (!animationKey.isEmpty())
- m_owner->animationEnded(animationKey);
-}
-
-- (void)setOwner:(PlatformCALayer*)owner
-{
- m_owner = owner;
-}
-
-@end
-
-void PlatformCALayerMac::setOwner(PlatformCALayerClient* owner)
-{
- PlatformCALayer::setOwner(owner);
-
- // Change the delegate's owner if needed
- if (m_delegate)
- [static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:this];
-}
-
-static NSString *toCAFilterType(PlatformCALayer::FilterType type)
-{
- switch (type) {
- case PlatformCALayer::Linear: return kCAFilterLinear;
- case PlatformCALayer::Nearest: return kCAFilterNearest;
- case PlatformCALayer::Trilinear: return kCAFilterTrilinear;
- default: return 0;
- }
-}
-
-PlatformCALayer::LayerType PlatformCALayerMac::layerTypeForPlatformLayer(PlatformLayer* layer)
-{
- if ([layer isKindOfClass:getAVPlayerLayerClass()] || [layer isKindOfClass:objc_getClass("WebVideoContainerLayer")])
- return LayerTypeAVPlayerLayer;
-
- if ([layer isKindOfClass:[WebGLLayer class]])
- return LayerTypeWebGLLayer;
-
- return LayerTypeCustom;
-}
-
-PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformCALayerClient* owner)
- : PlatformCALayer(layerType, owner)
- , m_customAppearance(GraphicsLayer::NoCustomAppearance)
-{
- Class layerClass = Nil;
- switch (layerType) {
- case LayerTypeLayer:
- case LayerTypeRootLayer:
- layerClass = [CALayer class];
- break;
- case LayerTypeScrollingLayer:
- // Scrolling layers only have special behavior with PlatformCALayerRemote.
- // fallthrough
- case LayerTypeWebLayer:
- layerClass = [WebLayer class];
- break;
- case LayerTypeSimpleLayer:
- case LayerTypeTiledBackingTileLayer:
- layerClass = [WebSimpleLayer class];
- break;
- case LayerTypeTransformLayer:
- layerClass = [CATransformLayer class];
- break;
- case LayerTypeBackdropLayer:
- case LayerTypeLightSystemBackdropLayer:
- case LayerTypeDarkSystemBackdropLayer:
-#if ENABLE(FILTERS_LEVEL_2)
- layerClass = [CABackdropLayer class];
-#else
- ASSERT_NOT_REACHED();
- layerClass = [CALayer class];
-#endif
- break;
- case LayerTypeWebTiledLayer:
- ASSERT_NOT_REACHED();
- break;
- case LayerTypeTiledBackingLayer:
- case LayerTypePageTiledBackingLayer:
- layerClass = [WebTiledBackingLayer class];
- break;
- case LayerTypeAVPlayerLayer:
- layerClass = getAVPlayerLayerClass();
- break;
- case LayerTypeWebGLLayer:
- // We don't create PlatformCALayerMacs wrapped around WebGLLayers.
- ASSERT_NOT_REACHED();
- break;
- case LayerTypeShapeLayer:
- layerClass = [CAShapeLayer class];
- // fillColor defaults to opaque black.
- break;
- case LayerTypeCustom:
- break;
- }
-
- if (layerClass)
- m_layer = adoptNS([(CALayer *)[layerClass alloc] init]);
-
- commonInit();
-}
-
-PlatformCALayerMac::PlatformCALayerMac(PlatformLayer* layer, PlatformCALayerClient* owner)
- : PlatformCALayer(layerTypeForPlatformLayer(layer), owner)
- , m_customAppearance(GraphicsLayer::NoCustomAppearance)
-{
- m_layer = layer;
- commonInit();
-}
-
-void PlatformCALayerMac::commonInit()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- // Save a pointer to 'this' in the CALayer
- [m_layer setValue:[NSValue valueWithPointer:this] forKey:platformCALayerPointer];
-
- // Clear all the implicit animations on the CALayer
- if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeScrollingLayer || m_layerType == LayerTypeCustom)
- [m_layer web_disableAllActions];
- else
- [m_layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
-
- // So that the scrolling thread's performance logging code can find all the tiles, mark this as being a tile.
- if (m_layerType == LayerTypeTiledBackingTileLayer)
- [m_layer setValue:@YES forKey:@"isTile"];
-
- if (usesTiledBackingLayer()) {
- WebTiledBackingLayer* tiledBackingLayer = static_cast<WebTiledBackingLayer*>(m_layer.get());
- TileController* tileController = [tiledBackingLayer createTileController:this];
-
- m_customSublayers = std::make_unique<PlatformCALayerList>(tileController->containerLayers());
- }
-
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-PassRefPtr<PlatformCALayer> PlatformCALayerMac::clone(PlatformCALayerClient* owner) const
-{
- LayerType type;
- switch (layerType()) {
- case LayerTypeTransformLayer:
- type = LayerTypeTransformLayer;
- break;
- case LayerTypeAVPlayerLayer:
- type = LayerTypeAVPlayerLayer;
- break;
- case LayerTypeShapeLayer:
- type = LayerTypeShapeLayer;
- break;
- case LayerTypeLayer:
- default:
- type = LayerTypeLayer;
- break;
- };
- RefPtr<PlatformCALayer> newLayer = PlatformCALayerMac::create(type, owner);
-
- newLayer->setPosition(position());
- newLayer->setBounds(bounds());
- newLayer->setAnchorPoint(anchorPoint());
- newLayer->setTransform(transform());
- newLayer->setSublayerTransform(sublayerTransform());
- newLayer->setContents(contents());
- newLayer->setMasksToBounds(masksToBounds());
- newLayer->setDoubleSided(isDoubleSided());
- newLayer->setOpaque(isOpaque());
- newLayer->setBackgroundColor(backgroundColor());
- newLayer->setContentsScale(contentsScale());
- newLayer->setCornerRadius(cornerRadius());
- newLayer->copyFiltersFrom(*this);
- newLayer->updateCustomAppearance(customAppearance());
-
- if (type == LayerTypeAVPlayerLayer) {
- ASSERT([newLayer->platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
- ASSERT([platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
-
- AVPlayerLayer* destinationPlayerLayer = static_cast<AVPlayerLayer *>(newLayer->platformLayer());
- AVPlayerLayer* sourcePlayerLayer = static_cast<AVPlayerLayer *>(platformLayer());
- dispatch_async(dispatch_get_main_queue(), ^{
- [destinationPlayerLayer setPlayer:[sourcePlayerLayer player]];
- });
- }
-
- if (type == LayerTypeShapeLayer)
- newLayer->setShapeRoundedRect(shapeRoundedRect());
-
- return newLayer;
-}
-
-PlatformCALayerMac::~PlatformCALayerMac()
-{
- [m_layer setValue:nil forKey:platformCALayerPointer];
-
- // Remove the owner pointer from the delegate in case there is a pending animationStarted event.
- [static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:nil];
-
- if (usesTiledBackingLayer())
- [static_cast<WebTiledBackingLayer *>(m_layer.get()) invalidate];
-}
-
-void PlatformCALayerMac::animationStarted(const String& animationKey, CFTimeInterval beginTime)
-{
- if (m_owner)
- m_owner->platformCALayerAnimationStarted(animationKey, beginTime);
-}
-
-void PlatformCALayerMac::animationEnded(const String& animationKey)
-{
- if (m_owner)
- m_owner->platformCALayerAnimationEnded(animationKey);
-}
-
-void PlatformCALayerMac::setNeedsDisplay()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setNeedsDisplay];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setNeedsDisplayInRect(const FloatRect& dirtyRect)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setNeedsDisplayInRect:dirtyRect];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::copyContentsFromLayer(PlatformCALayer* layer)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- CALayer* caLayer = layer->m_layer.get();
- if ([m_layer contents] != [caLayer contents])
- [m_layer setContents:[caLayer contents]];
- else
- [m_layer setContentsChanged];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-PlatformCALayer* PlatformCALayerMac::superlayer() const
-{
- return platformCALayer([m_layer superlayer]);
-}
-
-void PlatformCALayerMac::removeFromSuperlayer()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer removeFromSuperlayer];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setSublayers(const PlatformCALayerList& list)
-{
- // Short circuiting here avoids the allocation of the array below.
- if (list.size() == 0) {
- removeAllSublayers();
- return;
- }
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- NSMutableArray* sublayers = [[NSMutableArray alloc] init];
- for (size_t i = 0; i < list.size(); ++i)
- [sublayers addObject:list[i]->m_layer.get()];
-
- [m_layer setSublayers:sublayers];
- [sublayers release];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::removeAllSublayers()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setSublayers:nil];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::appendSublayer(PlatformCALayer& layer)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- ASSERT(m_layer != layer.m_layer);
- [m_layer addSublayer:layer.m_layer.get()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::insertSublayer(PlatformCALayer& layer, size_t index)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- ASSERT(m_layer != layer.m_layer);
- [m_layer insertSublayer:layer.m_layer.get() atIndex:index];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::replaceSublayer(PlatformCALayer& reference, PlatformCALayer& layer)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- ASSERT(m_layer != layer.m_layer);
- [m_layer replaceSublayer:reference.m_layer.get() with:layer.m_layer.get()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::adoptSublayers(PlatformCALayer& source)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setSublayers:[source.m_layer.get() sublayers]];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::addAnimationForKey(const String& key, PlatformCAAnimation& animation)
-{
- // Add the delegate
- if (!m_delegate) {
- WebAnimationDelegate* webAnimationDelegate = [[WebAnimationDelegate alloc] init];
- m_delegate = adoptNS(webAnimationDelegate);
- [webAnimationDelegate setOwner:this];
- }
-
- CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>(downcast<PlatformCAAnimationMac>(animation).platformAnimation());
- if (![propertyAnimation delegate])
- [propertyAnimation setDelegate:static_cast<id>(m_delegate.get())];
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer addAnimation:propertyAnimation forKey:key];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::removeAnimationForKey(const String& key)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer removeAnimationForKey:key];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-PassRefPtr<PlatformCAAnimation> PlatformCALayerMac::animationForKey(const String& key)
-{
- CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>([m_layer animationForKey:key]);
- if (!propertyAnimation)
- return 0;
- return PlatformCAAnimationMac::create(propertyAnimation);
-}
-
-void PlatformCALayerMac::setMask(PlatformCALayer* layer)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setMask:layer ? layer->platformLayer() : nil];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-bool PlatformCALayerMac::isOpaque() const
-{
- return [m_layer isOpaque];
-}
-
-void PlatformCALayerMac::setOpaque(bool value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setOpaque:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-FloatRect PlatformCALayerMac::bounds() const
-{
- return [m_layer bounds];
-}
-
-void PlatformCALayerMac::setBounds(const FloatRect& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setBounds:value];
-
- if (requiresCustomAppearanceUpdateOnBoundsChange())
- updateCustomAppearance(m_customAppearance);
-
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-FloatPoint3D PlatformCALayerMac::position() const
-{
- CGPoint point = [m_layer position];
- return FloatPoint3D(point.x, point.y, [m_layer zPosition]);
-}
-
-void PlatformCALayerMac::setPosition(const FloatPoint3D& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setPosition:CGPointMake(value.x(), value.y())];
- [m_layer setZPosition:value.z()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-FloatPoint3D PlatformCALayerMac::anchorPoint() const
-{
- CGPoint point = [m_layer anchorPoint];
- float z = 0;
- z = [m_layer anchorPointZ];
- return FloatPoint3D(point.x, point.y, z);
-}
-
-void PlatformCALayerMac::setAnchorPoint(const FloatPoint3D& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setAnchorPoint:CGPointMake(value.x(), value.y())];
- [m_layer setAnchorPointZ:value.z()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-TransformationMatrix PlatformCALayerMac::transform() const
-{
- return [m_layer transform];
-}
-
-void PlatformCALayerMac::setTransform(const TransformationMatrix& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setTransform:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-TransformationMatrix PlatformCALayerMac::sublayerTransform() const
-{
- return [m_layer sublayerTransform];
-}
-
-void PlatformCALayerMac::setSublayerTransform(const TransformationMatrix& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setSublayerTransform:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setHidden(bool value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setHidden:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setBackingStoreAttached(bool)
-{
- // We could throw away backing store here with setContents:nil.
-}
-
-bool PlatformCALayerMac::backingStoreAttached() const
-{
- return true;
-}
-
-void PlatformCALayerMac::setGeometryFlipped(bool value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setGeometryFlipped:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-bool PlatformCALayerMac::isDoubleSided() const
-{
- return [m_layer isDoubleSided];
-}
-
-void PlatformCALayerMac::setDoubleSided(bool value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setDoubleSided:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-bool PlatformCALayerMac::masksToBounds() const
-{
- return [m_layer masksToBounds];
-}
-
-void PlatformCALayerMac::setMasksToBounds(bool value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setMasksToBounds:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-bool PlatformCALayerMac::acceleratesDrawing() const
-{
- return [m_layer acceleratesDrawing];
-}
-
-void PlatformCALayerMac::setAcceleratesDrawing(bool acceleratesDrawing)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setAcceleratesDrawing:acceleratesDrawing];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-CFTypeRef PlatformCALayerMac::contents() const
-{
- return [m_layer contents];
-}
-
-void PlatformCALayerMac::setContents(CFTypeRef value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setContents:static_cast<id>(const_cast<void*>(value))];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setContentsRect(const FloatRect& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setContentsRect:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setMinificationFilter(FilterType value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setMinificationFilter:toCAFilterType(value)];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setMagnificationFilter(FilterType value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setMagnificationFilter:toCAFilterType(value)];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-Color PlatformCALayerMac::backgroundColor() const
-{
- return [m_layer backgroundColor];
-}
-
-void PlatformCALayerMac::setBackgroundColor(const Color& value)
-{
- CGFloat components[4];
- value.getRGBA(components[0], components[1], components[2], components[3]);
-
- RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
- RetainPtr<CGColorRef> color = adoptCF(CGColorCreate(colorSpace.get(), components));
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setBackgroundColor:color.get()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setBorderWidth(float value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setBorderWidth:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setBorderColor(const Color& value)
-{
- if (value.isValid()) {
- CGFloat components[4];
- value.getRGBA(components[0], components[1], components[2], components[3]);
-
- RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
- RetainPtr<CGColorRef> color = adoptCF(CGColorCreate(colorSpace.get(), components));
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setBorderColor:color.get()];
- END_BLOCK_OBJC_EXCEPTIONS
- } else {
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setBorderColor:nil];
- END_BLOCK_OBJC_EXCEPTIONS
- }
-}
-
-float PlatformCALayerMac::opacity() const
-{
- return [m_layer opacity];
-}
-
-void PlatformCALayerMac::setOpacity(float value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setOpacity:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setFilters(const FilterOperations& filters)
-{
- PlatformCAFilters::setFiltersOnLayer(platformLayer(), filters);
-}
-
-void PlatformCALayerMac::copyFiltersFrom(const PlatformCALayer& sourceLayer)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setFilters:[sourceLayer.platformLayer() filters]];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-bool PlatformCALayerMac::filtersCanBeComposited(const FilterOperations& filters)
-{
- // Return false if there are no filters to avoid needless work
- if (!filters.size())
- return false;
-
- for (unsigned i = 0; i < filters.size(); ++i) {
- const FilterOperation* filterOperation = filters.at(i);
- switch (filterOperation->type()) {
- case FilterOperation::REFERENCE:
- return false;
- case FilterOperation::DROP_SHADOW:
- // FIXME: For now we can only handle drop-shadow is if it's last in the list
- if (i < (filters.size() - 1))
- return false;
- break;
- default:
- break;
- }
- }
-
- return true;
-}
-
-#if ENABLE(CSS_COMPOSITING)
-void PlatformCALayerMac::setBlendMode(BlendMode blendMode)
-{
- PlatformCAFilters::setBlendingFiltersOnLayer(platformLayer(), blendMode);
-}
-#endif
-
-void PlatformCALayerMac::setName(const String& value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setName:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setSpeed(float value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setSpeed:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setTimeOffset(CFTimeInterval value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setTimeOffset:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-float PlatformCALayerMac::contentsScale() const
-{
- return [m_layer contentsScale];
-}
-
-void PlatformCALayerMac::setContentsScale(float value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setContentsScale:value];
-#if PLATFORM(IOS)
- [m_layer setRasterizationScale:value];
-
- if (m_layerType == LayerTypeWebTiledLayer) {
- // This will invalidate all the tiles so we won't end up with stale tiles with the wrong scale in the wrong place,
- // see <rdar://problem/9434765> for more information.
- static NSDictionary *optionsDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCATiledLayerRemoveImmediately, nil];
- [(CATiledLayer *)m_layer.get() setNeedsDisplayInRect:[m_layer bounds] levelOfDetail:0 options:optionsDictionary];
- }
-#endif
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-float PlatformCALayerMac::cornerRadius() const
-{
- return [m_layer cornerRadius];
-}
-
-void PlatformCALayerMac::setCornerRadius(float value)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setCornerRadius:value];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setEdgeAntialiasingMask(unsigned mask)
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [m_layer setEdgeAntialiasingMask:mask];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-FloatRoundedRect PlatformCALayerMac::shapeRoundedRect() const
-{
- ASSERT(m_layerType == LayerTypeShapeLayer);
- if (m_shapeRoundedRect)
- return *m_shapeRoundedRect;
-
- return FloatRoundedRect();
-}
-
-void PlatformCALayerMac::setShapeRoundedRect(const FloatRoundedRect& roundedRect)
-{
- ASSERT(m_layerType == LayerTypeShapeLayer);
- m_shapeRoundedRect = std::make_unique<FloatRoundedRect>(roundedRect);
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- Path shapePath;
- shapePath.addRoundedRect(roundedRect);
- [(CAShapeLayer *)m_layer setPath:shapePath.platformPath()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-WindRule PlatformCALayerMac::shapeWindRule() const
-{
- ASSERT(m_layerType == LayerTypeShapeLayer);
-
- NSString *fillRule = [(CAShapeLayer *)m_layer fillRule];
- if ([fillRule isEqualToString:@"even-odd"])
- return RULE_EVENODD;
-
- return RULE_NONZERO;
-}
-
-void PlatformCALayerMac::setShapeWindRule(WindRule windRule)
-{
- ASSERT(m_layerType == LayerTypeShapeLayer);
-
- switch (windRule) {
- case RULE_NONZERO:
- [(CAShapeLayer *)m_layer setFillRule:@"non-zero"];
- break;
- case RULE_EVENODD:
- [(CAShapeLayer *)m_layer setFillRule:@"even-odd"];
- break;
- }
-}
-
-Path PlatformCALayerMac::shapePath() const
-{
- ASSERT(m_layerType == LayerTypeShapeLayer);
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- return Path(CGPathCreateMutableCopy([(CAShapeLayer *)m_layer path]));
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-void PlatformCALayerMac::setShapePath(const Path& path)
-{
- ASSERT(m_layerType == LayerTypeShapeLayer);
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [(CAShapeLayer *)m_layer setPath:path.platformPath()];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-
-bool PlatformCALayerMac::requiresCustomAppearanceUpdateOnBoundsChange() const
-{
- return m_customAppearance == GraphicsLayer::ScrollingShadow;
-}
-
-void PlatformCALayerMac::updateCustomAppearance(GraphicsLayer::CustomAppearance appearance)
-{
- if (m_customAppearance == appearance)
- return;
-
- m_customAppearance = appearance;
-
-#if ENABLE(RUBBER_BANDING)
- switch (appearance) {
- case GraphicsLayer::NoCustomAppearance:
- case GraphicsLayer::LightBackdropAppearance:
- case GraphicsLayer::DarkBackdropAppearance:
- ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer());
- ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer());
- break;
- case GraphicsLayer::ScrollingOverhang:
- ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer());
- break;
- case GraphicsLayer::ScrollingShadow:
- ScrollbarThemeMac::setUpOverhangAreaShadow(platformLayer());
- break;
- }
-#endif
-}
-
-TiledBacking* PlatformCALayerMac::tiledBacking()
-{
- if (!usesTiledBackingLayer())
- return nullptr;
-
- WebTiledBackingLayer *tiledBackingLayer = static_cast<WebTiledBackingLayer *>(m_layer.get());
- return [tiledBackingLayer tiledBacking];
-}
-
-#if PLATFORM(IOS)
-bool PlatformCALayer::isWebLayer()
-{
- BOOL result = NO;
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- result = [m_layer isKindOfClass:[WebLayer self]];
- END_BLOCK_OBJC_EXCEPTIONS
- return result;
-}
-
-void PlatformCALayer::setBoundsOnMainThread(CGRect bounds)
-{
- CALayer *layer = m_layer.get();
- dispatch_async(dispatch_get_main_queue(), ^{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [layer setBounds:bounds];
- END_BLOCK_OBJC_EXCEPTIONS
- });
-}
-
-void PlatformCALayer::setPositionOnMainThread(CGPoint position)
-{
- CALayer *layer = m_layer.get();
- dispatch_async(dispatch_get_main_queue(), ^{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [layer setPosition:position];
- END_BLOCK_OBJC_EXCEPTIONS
- });
-}
-
-void PlatformCALayer::setAnchorPointOnMainThread(FloatPoint3D value)
-{
- CALayer *layer = m_layer.get();
- dispatch_async(dispatch_get_main_queue(), ^{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [layer setAnchorPoint:CGPointMake(value.x(), value.y())];
- [layer setAnchorPointZ:value.z()];
- END_BLOCK_OBJC_EXCEPTIONS
- });
-}
-
-void PlatformCALayer::setTileSize(const IntSize& tileSize)
-{
- if (m_layerType != LayerTypeWebTiledLayer)
- return;
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [static_cast<WebTiledLayer*>(m_layer.get()) setTileSize:tileSize];
- END_BLOCK_OBJC_EXCEPTIONS
-}
-#endif // PLATFORM(IOS)
-
-PlatformCALayer::RepaintRectList PlatformCALayer::collectRectsToPaint(CGContextRef context, PlatformCALayer* platformCALayer)
-{
- __block double totalRectArea = 0;
- __block unsigned rectCount = 0;
- __block RepaintRectList dirtyRects;
-
- platformCALayer->enumerateRectsBeingDrawn(context, ^(CGRect rect) {
- if (++rectCount > webLayerMaxRectsToPaint)
- return;
-
- totalRectArea += rect.size.width * rect.size.height;
- dirtyRects.append(rect);
- });
-
- FloatRect clipBounds = CGContextGetClipBoundingBox(context);
- double clipArea = clipBounds.width() * clipBounds.height();
-
- if (rectCount >= webLayerMaxRectsToPaint || totalRectArea >= clipArea * webLayerWastedSpaceThreshold) {
- dirtyRects.clear();
- dirtyRects.append(clipBounds);
- }
-
- return dirtyRects;
-}
-
-void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList& dirtyRects)
-{
- WebCore::PlatformCALayerClient* layerContents = platformCALayer->owner();
- if (!layerContents)
- return;
-
-#if PLATFORM(IOS)
- WKSetCurrentGraphicsContext(context);
-#endif
-
- CGContextSaveGState(context);
-
- // We never use CompositingCoordinatesBottomUp on Mac.
- ASSERT(layerContents->platformCALayerContentsOrientation() == GraphicsLayer::CompositingCoordinatesTopDown);
-
-#if PLATFORM(IOS)
- FontAntialiasingStateSaver fontAntialiasingState(context, [platformCALayer->platformLayer() isOpaque]);
- fontAntialiasingState.setup([WAKWindow hasLandscapeOrientation]);
-#else
- [NSGraphicsContext saveGraphicsState];
-
- // Set up an NSGraphicsContext for the context, so that parts of AppKit that rely on
- // the current NSGraphicsContext (e.g. NSCell drawing) get the right one.
- NSGraphicsContext* layerContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:YES];
- [NSGraphicsContext setCurrentContext:layerContext];
-#endif
-
- GraphicsContext graphicsContext(context);
- graphicsContext.setIsCALayerContext(true);
- graphicsContext.setIsAcceleratedContext(platformCALayer->acceleratesDrawing());
-
- if (!layerContents->platformCALayerContentsOpaque()) {
- // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
- graphicsContext.setShouldSmoothFonts(false);
- graphicsContext.setAntialiasedFontDilationEnabled(true);
- }
-
-#if PLATFORM(MAC)
- // It's important to get the clip from the context, because it may be significantly
- // smaller than the layer bounds (e.g. tiled layers)
- ThemeMac::setFocusRingClipRect(CGContextGetClipBoundingBox(context));
-#endif
-
- for (const auto& rect : dirtyRects) {
- GraphicsContextStateSaver stateSaver(graphicsContext);
- graphicsContext.clip(rect);
-
- layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect);
- }
-
-#if PLATFORM(IOS)
- fontAntialiasingState.restore();
-#else
- ThemeMac::setFocusRingClipRect(FloatRect());
-
- [NSGraphicsContext restoreGraphicsState];
-#endif
-
- // Re-fetch the layer owner, since <rdar://problem/9125151> indicates that it might have been destroyed during painting.
- layerContents = platformCALayer->owner();
- ASSERT(layerContents);
-
- CGContextRestoreGState(context);
-
- // Always update the repaint count so that it's accurate even if the count itself is not shown. This will be useful
- // for the Web Inspector feeding this information through the LayerTreeAgent.
- int repaintCount = layerContents->platformCALayerIncrementRepaintCount(platformCALayer);
-
- if (!platformCALayer->usesTiledBackingLayer() && layerContents && layerContents->platformCALayerShowRepaintCounter(platformCALayer))
- drawRepaintIndicator(context, platformCALayer, repaintCount, nullptr);
-}
-
-CGRect PlatformCALayer::frameForLayer(const PlatformLayer* tileLayer)
-{
- return [tileLayer frame];
-}
-
-PassRefPtr<PlatformCALayer> PlatformCALayerMac::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
-{
- return PlatformCALayerMac::create(layerType, client);
-}
-
-void PlatformCALayerMac::enumerateRectsBeingDrawn(CGContextRef context, void (^block)(CGRect))
-{
- wkCALayerEnumerateRectsBeingDrawnWithBlock(m_layer.get(), context, block);
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacWebTiledBackingLayerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebTiledBackingLayer_h
-#define WebTiledBackingLayer_h
-
-#import <QuartzCore/QuartzCore.h>
-
-namespace WebCore {
-class IntRect;
-class PlatformCALayer;
-class TileController;
-class TiledBacking;
-}
-
-@interface WebTiledBackingLayer : CALayer {
- std::unique_ptr<WebCore::TileController> _tileController;
-}
-
-- (WebCore::TileController*)createTileController:(WebCore::PlatformCALayer*)rootLayer;
-- (WebCore::TiledBacking*)tiledBacking;
-- (void)invalidate;
-
-@end
-
-#endif // WebTiledBackingLayer_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacWebTiledBackingLayermm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "WebTiledBackingLayer.h"
-
-#import "IntRect.h"
-#import "TileController.h"
-#import <wtf/MainThread.h>
-
-using namespace WebCore;
-
-@implementation WebTiledBackingLayer
-
-- (id)init
-{
- self = [super init];
- if (!self)
- return nil;
-
-#ifndef NDEBUG
- [self setName:@"WebTiledBackingLayer"];
-#endif
- return self;
-}
-
-- (void)dealloc
-{
- ASSERT(!_tileController);
-
- [super dealloc];
-}
-
-- (id)initWithLayer:(id)layer
-{
- UNUSED_PARAM(layer);
-
- ASSERT_NOT_REACHED();
- return nil;
-}
-
-- (TileController*)createTileController:(PlatformCALayer*)rootLayer
-{
- ASSERT(!_tileController);
- _tileController = std::make_unique<WebCore::TileController>(rootLayer);
- return _tileController.get();
-}
-
-- (id<CAAction>)actionForKey:(NSString *)key
-{
- UNUSED_PARAM(key);
-
- // Disable all animations.
- return nil;
-}
-
-- (void)setBounds:(CGRect)bounds
-{
- [super setBounds:bounds];
-
- _tileController->tileCacheLayerBoundsChanged();
-}
-
-- (void)setOpaque:(BOOL)opaque
-{
- _tileController->setTilesOpaque(opaque);
-}
-
-- (BOOL)isOpaque
-{
- return _tileController ? _tileController->tilesAreOpaque() : NO;
-}
-
-- (void)setNeedsDisplay
-{
- _tileController->setNeedsDisplay();
-}
-
-- (void)setNeedsDisplayInRect:(CGRect)rect
-{
- _tileController->setNeedsDisplayInRect(enclosingIntRect(rect));
-}
-
-- (void)setAcceleratesDrawing:(BOOL)acceleratesDrawing
-{
- _tileController->setAcceleratesDrawing(acceleratesDrawing);
-}
-
-- (BOOL)acceleratesDrawing
-{
- return _tileController ? _tileController->acceleratesDrawing() : NO;
-}
-
-- (void)setContentsScale:(CGFloat)contentsScale
-{
- _tileController->setContentsScale(contentsScale);
-}
-
-- (CGFloat)contentsScale
-{
- return _tileController ? _tileController->contentsScale() : 1;
-}
-
-- (WebCore::TiledBacking*)tiledBacking
-{
- return _tileController.get();
-}
-
-- (void)invalidate
-{
- ASSERT(isMainThread());
- ASSERT(_tileController);
- _tileController = nullptr;
-}
-
-- (void)setBorderColor:(CGColorRef)borderColor
-{
- _tileController->setTileDebugBorderColor(Color(borderColor));
-}
-
-- (void)setBorderWidth:(CGFloat)borderWidth
-{
- // Tiles adjoin, so halve the border width.
- _tileController->setTileDebugBorderWidth(borderWidth / 2);
-}
-
-@end
</del></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-06-22 Dean Jackson <dino@apple.com>
+
+ Rename PlatformCA*Mac to PlatformCA*Cocoa
+ https://bugs.webkit.org/show_bug.cgi?id=146224
+ <rdar://problem/21497182>
+
+ Reviewed by Simon Fraser.
+
+ Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
+ to the more accurate Cocoa suffix.
+
+ * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+ (WebKit::PlatformCALayerRemote::filtersCanBeComposited):
+ * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
+ (WebKit::PlatformCALayerRemoteCustom::create):
+ * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
+
</ins><span class="cx"> 2015-06-22 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Simplify Connection::SyncMessageState
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #import "WebCoreArgumentCoders.h"
</span><span class="cx"> #import <WebCore/BlockExceptions.h>
</span><span class="cx"> #import <WebCore/GraphicsLayer.h>
</span><del>-#import <WebCore/PlatformCAAnimationMac.h>
</del><ins>+#import <WebCore/PlatformCAAnimationCocoa.h>
</ins><span class="cx"> #import <WebCore/PlatformCAFilters.h>
</span><span class="cx"> #import <WebCore/TimingFunction.h>
</span><span class="cx"> #import <wtf/CurrentTime.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> #import <WebCore/GraphicsLayerCA.h>
</span><span class="cx"> #import <WebCore/LengthFunctions.h>
</span><span class="cx"> #import <WebCore/PlatformCAFilters.h>
</span><del>-#import <WebCore/PlatformCALayerMac.h>
</del><ins>+#import <WebCore/PlatformCALayerCocoa.h>
</ins><span class="cx"> #import <WebCore/TiledBacking.h>
</span><span class="cx"> #import <wtf/CurrentTime.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="lines">@@ -651,7 +651,7 @@
</span><span class="cx">
</span><span class="cx"> bool PlatformCALayerRemote::filtersCanBeComposited(const FilterOperations& filters)
</span><span class="cx"> {
</span><del>- return PlatformCALayerMac::filtersCanBeComposited(filters);
</del><ins>+ return PlatformCALayerCocoa::filtersCanBeComposited(filters);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PlatformCALayerRemote::setName(const String& value)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustommm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #import "WebProcess.h"
</span><span class="cx"> #import <AVFoundation/AVFoundation.h>
</span><span class="cx"> #import <WebCore/GraphicsLayerCA.h>
</span><del>-#import <WebCore/PlatformCALayerMac.h>
</del><ins>+#import <WebCore/PlatformCALayerCocoa.h>
</ins><span class="cx"> #import <WebCore/SoftLinking.h>
</span><span class="cx"> #import <WebCore/WebCoreCALayerExtras.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemoteCustom::create(PlatformLayer *platformLayer, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
</span><span class="cx"> {
</span><del>- RefPtr<PlatformCALayerRemote> layer = adoptRef(new PlatformCALayerRemoteCustom(PlatformCALayerMac::layerTypeForPlatformLayer(platformLayer), platformLayer, owner, context));
</del><ins>+ RefPtr<PlatformCALayerRemote> layer = adoptRef(new PlatformCALayerRemoteCustom(PlatformCALayerCocoa::layerTypeForPlatformLayer(platformLayer), platformLayer, owner, context));
</ins><span class="cx"> context.layerWasCreated(*layer, layer->layerType());
</span><span class="cx">
</span><span class="cx"> return layer.release();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteTiledBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #import "RemoteLayerTreeContext.h"
</span><span class="cx"> #import <WebCore/GraphicsLayerCA.h>
</span><del>-#import <WebCore/PlatformCALayerMac.h>
</del><ins>+#import <WebCore/PlatformCALayerCocoa.h>
</ins><span class="cx"> #import <WebCore/TiledBacking.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (185855 => 185856)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-06-23 01:24:02 UTC (rev 185855)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-06-23 01:51:05 UTC (rev 185856)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> #import <WebCore/MachSendRight.h>
</span><span class="cx"> #import <WebCore/MainFrame.h>
</span><span class="cx"> #import <WebCore/Page.h>
</span><del>-#import <WebCore/PlatformCAAnimationMac.h>
</del><ins>+#import <WebCore/PlatformCAAnimationCocoa.h>
</ins><span class="cx"> #import <WebCore/RenderLayerBacking.h>
</span><span class="cx"> #import <WebCore/RenderLayerCompositor.h>
</span><span class="cx"> #import <WebCore/RenderView.h>
</span><span class="lines">@@ -753,7 +753,7 @@
</span><span class="cx"> transform.scale(scale);
</span><span class="cx">
</span><span class="cx"> RetainPtr<CABasicAnimation> renderViewAnimationCA = transientZoomSnapAnimationForKeyPath("transform");
</span><del>- RefPtr<PlatformCAAnimation> renderViewAnimation = PlatformCAAnimationMac::create(renderViewAnimationCA.get());
</del><ins>+ RefPtr<PlatformCAAnimation> renderViewAnimation = PlatformCAAnimationCocoa::create(renderViewAnimationCA.get());
</ins><span class="cx"> renderViewAnimation->setToValue(transform);
</span><span class="cx">
</span><span class="cx"> RetainPtr<CALayer> shadowCALayer;
</span></span></pre>
</div>
</div>
</body>
</html>