Title: [187107] trunk/Source/WebKit/ios
- Revision
- 187107
- Author
- [email protected]
- Date
- 2015-07-21 10:14:00 -0700 (Tue, 21 Jul 2015)
Log Message
Expose shrink-wrapping as UIKit support SPI
https://bugs.webkit.org/show_bug.cgi?id=147148
<rdar://problem/21920008>
Reviewed by Simon Fraser.
* Misc/WebUIKitSupport.h:
* Misc/WebUIKitSupport.mm:
(WebKitCreatePathWithShrinkWrappedRects):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ios/ChangeLog (187106 => 187107)
--- trunk/Source/WebKit/ios/ChangeLog 2015-07-21 17:06:29 UTC (rev 187106)
+++ trunk/Source/WebKit/ios/ChangeLog 2015-07-21 17:14:00 UTC (rev 187107)
@@ -1,3 +1,15 @@
+2015-07-21 Tim Horton <[email protected]>
+
+ Expose shrink-wrapping as UIKit support SPI
+ https://bugs.webkit.org/show_bug.cgi?id=147148
+ <rdar://problem/21920008>
+
+ Reviewed by Simon Fraser.
+
+ * Misc/WebUIKitSupport.h:
+ * Misc/WebUIKitSupport.mm:
+ (WebKitCreatePathWithShrinkWrappedRects):
+
2015-07-02 Timothy Horton <[email protected]>
iOS WebKitLegacy should match WebKit2's viewport behavior
Modified: trunk/Source/WebKit/ios/Misc/WebUIKitSupport.h (187106 => 187107)
--- trunk/Source/WebKit/ios/Misc/WebUIKitSupport.h 2015-07-21 17:06:29 UTC (rev 187106)
+++ trunk/Source/WebKit/ios/Misc/WebUIKitSupport.h 2015-07-21 17:14:00 UTC (rev 187107)
@@ -61,6 +61,8 @@
const char *WebKitPlatformSystemRootDirectory(void);
+CGPathRef WebKitCreatePathWithShrinkWrappedRects(NSArray* cgRects, CGFloat radius);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm (187106 => 187107)
--- trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm 2015-07-21 17:06:29 UTC (rev 187106)
+++ trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm 2015-07-21 17:14:00 UTC (rev 187107)
@@ -27,19 +27,19 @@
#import "WebUIKitSupport.h"
-#import <WebCore/break_lines.h>
-#import <WebCore/ResourceRequest.h>
-#import <WebCore/TextBreakIterator.h>
-#import <WebCore/WebCoreSystemInterface.h>
-#import <WebCore/WebCoreThreadSystemInterface.h>
#import "WebDatabaseManagerInternal.h"
#import "WebKitSystemInterface.h"
#import "WebLocalizableStrings.h"
#import "WebPlatformStrategies.h"
#import "WebSystemInterface.h"
#import "WebViewPrivate.h"
+#import <WebCore/PathUtilities.h>
+#import <WebCore/ResourceRequest.h>
+#import <WebCore/TextBreakIterator.h>
+#import <WebCore/WebCoreSystemInterface.h>
+#import <WebCore/WebCoreThreadSystemInterface.h>
+#import <WebCore/break_lines.h>
-
#import <runtime/InitializeThreading.h>
using namespace WebCore;
@@ -173,4 +173,23 @@
endBackgroundTaskBlock(taskIdentifier);
}
+CGPathRef WebKitCreatePathWithShrinkWrappedRects(NSArray* cgRects, CGFloat radius)
+{
+ Vector<FloatRect> rects;
+ rects.reserveInitialCapacity([cgRects count]);
+
+ const char* cgRectEncodedString = @encode(CGRect);
+
+ for (NSValue *rectValue in cgRects) {
+ CGRect cgRect;
+ [rectValue getValue:&cgRect];
+
+ if (strcmp(cgRectEncodedString, rectValue.objCType))
+ return nullptr;
+ rects.append(cgRect);
+ }
+
+ return CGPathRetain(PathUtilities::pathWithShrinkWrappedRects(rects, radius).platformPath());
+}
+
#endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes