Stop using some deprecated SPI in WKDrawingView
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 00:50:35 +0000 (00:50 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 00:50:35 +0000 (00:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195706
<rdar://problem/48062599>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView renderedDrawing]):
(-[WKDrawingView PNGRepresentation]):
(-[WKDrawingView loadDrawingFromPNGRepresentation:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKDrawingView.mm

index 548cc89..3212db8 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-13  Tim Horton  <timothy_horton@apple.com>
+
+        Stop using some deprecated SPI in WKDrawingView
+        https://bugs.webkit.org/show_bug.cgi?id=195706
+        <rdar://problem/48062599>
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/ios/WKDrawingView.mm:
+        (-[WKDrawingView renderedDrawing]):
+        (-[WKDrawingView PNGRepresentation]):
+        (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
+
 2019-03-13  Timothy Hatcher  <timothy@apple.com>
 
         Unreviewed speculative build fix for watchOS after r242908.
index 1dd04dd..53f2488 100644 (file)
@@ -116,11 +116,9 @@ static UIImage *emptyImage()
 
     __block RetainPtr<UIImage> resultImage;
 
-ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    [_renderer renderDrawing:[_pencilView drawing] completion:^(UIImage *image) {
+    [_renderer renderDrawing:[_pencilView nonNullDrawing] completion:^(UIImage *image) {
         resultImage = image;
     }];
-ALLOW_DEPRECATED_DECLARATIONS_END
 
     // FIXME: Ideally we would not synchronously wait for this rendering,
     // but NSFileWrapper requires data synchronously, and our clients expect
@@ -136,9 +134,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
     RetainPtr<UIImage> image = [self renderedDrawing];
     RetainPtr<NSMutableData> PNGData = adoptNS([[NSMutableData alloc] init]);
     RetainPtr<CGImageDestinationRef> imageDestination = adoptCF(CGImageDestinationCreateWithData((__bridge CFMutableDataRef)PNGData.get(), kUTTypePNG, 1, nil));
-ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    NSString *base64Drawing = [[[_pencilView drawing] serialize] base64EncodedStringWithOptions:0];
-ALLOW_DEPRECATED_DECLARATIONS_END
+    NSString *base64Drawing = [[[_pencilView nonNullDrawing] serialize] base64EncodedStringWithOptions:0];
     NSDictionary *properties = nil;
     if (base64Drawing) {
         // FIXME: We should put this somewhere less user-facing than the EXIF User Comment field.
@@ -166,9 +162,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
         return;
     RetainPtr<NSData> drawingData = adoptNS([[NSData alloc] initWithBase64EncodedString:base64Drawing options:0]);
     RetainPtr<PKDrawing> drawing = adoptNS([WebKit::allocPKDrawingInstance() initWithData:drawingData.get() error:nil]);
-ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    [_pencilView setDrawing:drawing.get()];
-ALLOW_DEPRECATED_DECLARATIONS_END
+    [_pencilView setNonNullDrawing:drawing.get()];
 }
 
 - (void)canvasViewDrawingDidChange:(PKCanvasView *)canvasView