Title: [183349] trunk/Source/WebKit2
Revision
183349
Author
[email protected]
Date
2015-04-25 23:00:29 -0700 (Sat, 25 Apr 2015)

Log Message

Further update gesture swipe shadow style
https://bugs.webkit.org/show_bug.cgi?id=144215
<rdar://problem/19295843>

Reviewed by Dan Bernstein.

* Resources/mac/SwipeShadow.png: Removed.
* Resources/mac/[email protected]: 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.

Modified Paths

Removed Paths

  • trunk/Source/WebKit2/Resources/mac/

Diff

Modified: trunk/Source/WebKit2/ChangeLog (183348 => 183349)


--- 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)
@@ -1,3 +1,19 @@
+2015-04-25  Tim Horton  <[email protected]>
+
+        Further update gesture swipe shadow style
+        https://bugs.webkit.org/show_bug.cgi?id=144215
+        <rdar://problem/19295843>
+
+        Reviewed by Dan Bernstein.
+
+        * Resources/mac/SwipeShadow.png: Removed.
+        * Resources/mac/[email protected]: 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.
+
 2015-04-25  Dan Bernstein  <[email protected]>
 
         WebKit2 part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE

Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h (183348 => 183349)


--- 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)
@@ -44,6 +44,7 @@
 OBJC_CLASS _UIViewControllerOneToOneTransitionContext;
 OBJC_CLASS _UIViewControllerTransitionContext;
 #else
+OBJC_CLASS CAGradientLayer;
 OBJC_CLASS NSEvent;
 OBJC_CLASS NSView;
 OBJC_CLASS WKSwipeCancellationTracker;
@@ -187,7 +188,7 @@
     RetainPtr<WKSwipeCancellationTracker> m_swipeCancellationTracker;
     RetainPtr<CALayer> m_swipeLayer;
     RetainPtr<CALayer> m_swipeSnapshotLayer;
-    RetainPtr<CALayer> m_swipeShadowLayer;
+    RetainPtr<CAGradientLayer> m_swipeShadowLayer;
     RetainPtr<CALayer> m_swipeDimmingLayer;
     Vector<RetainPtr<CALayer>> m_currentSwipeLiveLayers;
 

Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm (183348 => 183349)


--- 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)
@@ -68,8 +68,9 @@
 static const double swipeOverlayShadowOpacity = 0.66;
 static const double swipeOverlayShadowRadius = 3;
 #else
-static const double swipeOverlayShadowOpacity = 0.47;
+static const double swipeOverlayShadowOpacity = 0.06;
 static const double swipeOverlayDimmingOpacity = 0.12;
+static const CGFloat swipeOverlayShadowWidth = 81;
 #endif
 
 static const CGFloat minimumHorizontalSwipeDistance = 15;
@@ -631,12 +632,47 @@
         [m_swipeDimmingLayer setGeometryFlipped:geometryIsFlippedToRoot];
         [m_swipeDimmingLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
 
-        NSImage *shadowImage = [[NSBundle bundleForClass:[WKSwipeCancellationTracker class]] imageForResource:@"SwipeShadow"];
-        FloatRect shadowRect(-shadowImage.size.width, topContentInset, shadowImage.size.width, m_webPageProxy.viewSize().height() - topContentInset);
-        m_swipeShadowLayer = adoptNS([[CALayer alloc] init]);
+        FloatRect shadowRect(-swipeOverlayShadowWidth, topContentInset, swipeOverlayShadowWidth, m_webPageProxy.viewSize().height() - topContentInset);
+        m_swipeShadowLayer = adoptNS([[CAGradientLayer alloc] init]);
         [m_swipeShadowLayer setName:@"Gesture Swipe Shadow Layer"];
-        [m_swipeShadowLayer setBackgroundColor:[NSColor colorWithPatternImage:shadowImage].CGColor];
-        [m_swipeShadowLayer setContentsScale:deviceScaleFactor];
+        [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)];
         [m_swipeShadowLayer setOpacity:swipeOverlayShadowOpacity];
         [m_swipeShadowLayer setAnchorPoint:CGPointZero];
         [m_swipeShadowLayer setFrame:shadowRect];

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (183348 => 183349)


--- 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)
@@ -667,8 +667,6 @@
 		2DACE64E18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DACE64D18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h */; };
 		2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */; };
 		2DAF06D718BD1A470081CEB1 /* SmartMagnificationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */; };
-		2DC658351AD7237600D44508 /* SwipeShadow.png in Resources */ = {isa = PBXBuildFile; fileRef = 2DC658331AD7237600D44508 /* SwipeShadow.png */; };
-		2DC658361AD7237600D44508 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 2DC658341AD7237600D44508 /* [email protected] */; };
 		2DC6D9C318C44A610043BAD4 /* WKWebViewContentProviderRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */; };
 		2DC6D9C418C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */; };
 		2DD12A081A8177F3002C74E6 /* WKPageRenderingProgressEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD12A071A8177F3002C74E6 /* WKPageRenderingProgressEvents.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2837,8 +2835,6 @@
 		2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmartMagnificationController.h; path = ios/SmartMagnificationController.h; sourceTree = "<group>"; };
 		2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SmartMagnificationController.mm; path = ios/SmartMagnificationController.mm; sourceTree = "<group>"; };
 		2DAF06D818BD23BA0081CEB1 /* SmartMagnificationController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = SmartMagnificationController.messages.in; path = ios/SmartMagnificationController.messages.in; sourceTree = "<group>"; };
-		2DC658331AD7237600D44508 /* SwipeShadow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SwipeShadow.png; sourceTree = "<group>"; };
-		2DC658341AD7237600D44508 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
 		2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewContentProviderRegistry.h; sourceTree = "<group>"; };
 		2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewContentProviderRegistry.mm; sourceTree = "<group>"; };
 		2DD12A071A8177F3002C74E6 /* WKPageRenderingProgressEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageRenderingProgressEvents.h; sourceTree = "<group>"; };
@@ -5522,8 +5518,6 @@
 		37F8C94F1AE22BD8007DAB9E /* mac */ = {
 			isa = PBXGroup;
 			children = (
-				2DC658331AD7237600D44508 /* SwipeShadow.png */,
-				2DC658341AD7237600D44508 /* [email protected] */,
 			);
 			name = mac;
 			path = Resources/mac;
@@ -8943,8 +8937,6 @@
 				E17AE2C316B9C63A001C42F1 /* com.apple.WebKit.NetworkProcess.sb in Resources */,
 				E11D35AE16B63D1B006D23D7 /* com.apple.WebProcess.sb in Resources */,
 				8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
-				2DC658351AD7237600D44508 /* SwipeShadow.png in Resources */,
-				2DC658361AD7237600D44508 /* [email protected] in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to