<!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>[183349] trunk/Source/WebKit2</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/183349">183349</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-04-25 23:00:29 -0700 (Sat, 25 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Further update gesture swipe shadow style
https://bugs.webkit.org/show_bug.cgi?id=144215
&lt;rdar://problem/19295843&gt;

Reviewed by Dan Bernstein.

* Resources/mac/SwipeShadow.png: Removed.
* Resources/mac/SwipeShadow@2x.png: Removed.
* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* WebKit2.xcodeproj/project.pbxproj:
Use a CAGradientLayer instead of PNGs for the swipe shadow.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacViewGestureControllerh">trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacViewGestureControllerMacmm">trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WebKit2/Resources/mac/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (183348 => 183349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-04-26 05:20:19 UTC (rev 183348)
+++ trunk/Source/WebKit2/ChangeLog        2015-04-26 06:00:29 UTC (rev 183349)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-04-25  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Further update gesture swipe shadow style
+        https://bugs.webkit.org/show_bug.cgi?id=144215
+        &lt;rdar://problem/19295843&gt;
+
+        Reviewed by Dan Bernstein.
+
+        * Resources/mac/SwipeShadow.png: Removed.
+        * Resources/mac/SwipeShadow@2x.png: Removed.
+        * UIProcess/mac/ViewGestureController.h:
+        * UIProcess/mac/ViewGestureControllerMac.mm:
+        (WebKit::ViewGestureController::beginSwipeGesture):
+        * WebKit2.xcodeproj/project.pbxproj:
+        Use a CAGradientLayer instead of PNGs for the swipe shadow.
+
</ins><span class="cx"> 2015-04-25  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit2 part of &lt;rdar://problem/20697966&gt; Avoid using TBD as an argument to NS_AVAILABLE
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacViewGestureControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h (183348 => 183349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h        2015-04-26 05:20:19 UTC (rev 183348)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h        2015-04-26 06:00:29 UTC (rev 183349)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> OBJC_CLASS _UIViewControllerOneToOneTransitionContext;
</span><span class="cx"> OBJC_CLASS _UIViewControllerTransitionContext;
</span><span class="cx"> #else
</span><ins>+OBJC_CLASS CAGradientLayer;
</ins><span class="cx"> OBJC_CLASS NSEvent;
</span><span class="cx"> OBJC_CLASS NSView;
</span><span class="cx"> OBJC_CLASS WKSwipeCancellationTracker;
</span><span class="lines">@@ -187,7 +188,7 @@
</span><span class="cx">     RetainPtr&lt;WKSwipeCancellationTracker&gt; m_swipeCancellationTracker;
</span><span class="cx">     RetainPtr&lt;CALayer&gt; m_swipeLayer;
</span><span class="cx">     RetainPtr&lt;CALayer&gt; m_swipeSnapshotLayer;
</span><del>-    RetainPtr&lt;CALayer&gt; m_swipeShadowLayer;
</del><ins>+    RetainPtr&lt;CAGradientLayer&gt; m_swipeShadowLayer;
</ins><span class="cx">     RetainPtr&lt;CALayer&gt; m_swipeDimmingLayer;
</span><span class="cx">     Vector&lt;RetainPtr&lt;CALayer&gt;&gt; m_currentSwipeLiveLayers;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacViewGestureControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm (183348 => 183349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm        2015-04-26 05:20:19 UTC (rev 183348)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm        2015-04-26 06:00:29 UTC (rev 183349)
</span><span class="lines">@@ -68,8 +68,9 @@
</span><span class="cx"> static const double swipeOverlayShadowOpacity = 0.66;
</span><span class="cx"> static const double swipeOverlayShadowRadius = 3;
</span><span class="cx"> #else
</span><del>-static const double swipeOverlayShadowOpacity = 0.47;
</del><ins>+static const double swipeOverlayShadowOpacity = 0.06;
</ins><span class="cx"> static const double swipeOverlayDimmingOpacity = 0.12;
</span><ins>+static const CGFloat swipeOverlayShadowWidth = 81;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static const CGFloat minimumHorizontalSwipeDistance = 15;
</span><span class="lines">@@ -631,12 +632,47 @@
</span><span class="cx">         [m_swipeDimmingLayer setGeometryFlipped:geometryIsFlippedToRoot];
</span><span class="cx">         [m_swipeDimmingLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</span><span class="cx"> 
</span><del>-        NSImage *shadowImage = [[NSBundle bundleForClass:[WKSwipeCancellationTracker class]] imageForResource:@&quot;SwipeShadow&quot;];
-        FloatRect shadowRect(-shadowImage.size.width, topContentInset, shadowImage.size.width, m_webPageProxy.viewSize().height() - topContentInset);
-        m_swipeShadowLayer = adoptNS([[CALayer alloc] init]);
</del><ins>+        FloatRect shadowRect(-swipeOverlayShadowWidth, topContentInset, swipeOverlayShadowWidth, m_webPageProxy.viewSize().height() - topContentInset);
+        m_swipeShadowLayer = adoptNS([[CAGradientLayer alloc] init]);
</ins><span class="cx">         [m_swipeShadowLayer setName:@&quot;Gesture Swipe Shadow Layer&quot;];
</span><del>-        [m_swipeShadowLayer setBackgroundColor:[NSColor colorWithPatternImage:shadowImage].CGColor];
-        [m_swipeShadowLayer setContentsScale:deviceScaleFactor];
</del><ins>+        [m_swipeShadowLayer setColors:@[
+            (id)CGColorCreateGenericGray(0, 1.),
+            (id)CGColorCreateGenericGray(0, 0.99),
+            (id)CGColorCreateGenericGray(0, 0.98),
+            (id)CGColorCreateGenericGray(0, 0.95),
+            (id)CGColorCreateGenericGray(0, 0.92),
+            (id)CGColorCreateGenericGray(0, 0.82),
+            (id)CGColorCreateGenericGray(0, 0.71),
+            (id)CGColorCreateGenericGray(0, 0.46),
+            (id)CGColorCreateGenericGray(0, 0.35),
+            (id)CGColorCreateGenericGray(0, 0.25),
+            (id)CGColorCreateGenericGray(0, 0.17),
+            (id)CGColorCreateGenericGray(0, 0.11),
+            (id)CGColorCreateGenericGray(0, 0.07),
+            (id)CGColorCreateGenericGray(0, 0.04),
+            (id)CGColorCreateGenericGray(0, 0.01),
+            (id)CGColorCreateGenericGray(0, 0.),
+        ]];
+        [m_swipeShadowLayer setLocations:@[
+            @0,
+            @0.03125,
+            @0.0625,
+            @0.0938,
+            @0.125,
+            @0.1875,
+            @0.25,
+            @0.375,
+            @0.4375,
+            @0.5,
+            @0.5625,
+            @0.625,
+            @0.6875,
+            @0.75,
+            @0.875,
+            @1,
+        ]];
+        [m_swipeShadowLayer setStartPoint:CGPointMake(1, 0)];
+        [m_swipeShadowLayer setEndPoint:CGPointMake(0, 0)];
</ins><span class="cx">         [m_swipeShadowLayer setOpacity:swipeOverlayShadowOpacity];
</span><span class="cx">         [m_swipeShadowLayer setAnchorPoint:CGPointZero];
</span><span class="cx">         [m_swipeShadowLayer setFrame:shadowRect];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (183348 => 183349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-04-26 05:20:19 UTC (rev 183348)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-04-26 06:00:29 UTC (rev 183349)
</span><span class="lines">@@ -667,8 +667,6 @@
</span><span class="cx">                 2DACE64E18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DACE64D18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h */; };
</span><span class="cx">                 2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */; };
</span><span class="cx">                 2DAF06D718BD1A470081CEB1 /* SmartMagnificationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */; };
</span><del>-                2DC658351AD7237600D44508 /* SwipeShadow.png in Resources */ = {isa = PBXBuildFile; fileRef = 2DC658331AD7237600D44508 /* SwipeShadow.png */; };
-                2DC658361AD7237600D44508 /* SwipeShadow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2DC658341AD7237600D44508 /* SwipeShadow@2x.png */; };
</del><span class="cx">                 2DC6D9C318C44A610043BAD4 /* WKWebViewContentProviderRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */; };
</span><span class="cx">                 2DC6D9C418C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */; };
</span><span class="cx">                 2DD12A081A8177F3002C74E6 /* WKPageRenderingProgressEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD12A071A8177F3002C74E6 /* WKPageRenderingProgressEvents.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2837,8 +2835,6 @@
</span><span class="cx">                 2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmartMagnificationController.h; path = ios/SmartMagnificationController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SmartMagnificationController.mm; path = ios/SmartMagnificationController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DAF06D818BD23BA0081CEB1 /* SmartMagnificationController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = SmartMagnificationController.messages.in; path = ios/SmartMagnificationController.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                2DC658331AD7237600D44508 /* SwipeShadow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SwipeShadow.png; sourceTree = &quot;&lt;group&gt;&quot;; };
-                2DC658341AD7237600D44508 /* SwipeShadow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = &quot;SwipeShadow@2x.png&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewContentProviderRegistry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewContentProviderRegistry.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DD12A071A8177F3002C74E6 /* WKPageRenderingProgressEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageRenderingProgressEvents.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5522,8 +5518,6 @@
</span><span class="cx">                 37F8C94F1AE22BD8007DAB9E /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                2DC658331AD7237600D44508 /* SwipeShadow.png */,
-                                2DC658341AD7237600D44508 /* SwipeShadow@2x.png */,
</del><span class="cx">                         );
</span><span class="cx">                         name = mac;
</span><span class="cx">                         path = Resources/mac;
</span><span class="lines">@@ -8943,8 +8937,6 @@
</span><span class="cx">                                 E17AE2C316B9C63A001C42F1 /* com.apple.WebKit.NetworkProcess.sb in Resources */,
</span><span class="cx">                                 E11D35AE16B63D1B006D23D7 /* com.apple.WebProcess.sb in Resources */,
</span><span class="cx">                                 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
</span><del>-                                2DC658351AD7237600D44508 /* SwipeShadow.png in Resources */,
-                                2DC658361AD7237600D44508 /* SwipeShadow@2x.png in Resources */,
</del><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre>
</div>
</div>

</body>
</html>