Title: [201366] trunk/Source/WebKit2
Revision
201366
Author
[email protected]
Date
2016-05-24 17:46:20 -0700 (Tue, 24 May 2016)

Log Message

_WKThumbnailView should expose its snapshot size
https://bugs.webkit.org/show_bug.cgi?id=158049

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKThumbnailView.h:
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView _didTakeSnapshot:]):
Update the new snapshotSize property in a KVO-compliant manner.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (201365 => 201366)


--- trunk/Source/WebKit2/ChangeLog	2016-05-25 00:45:14 UTC (rev 201365)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-25 00:46:20 UTC (rev 201366)
@@ -1,3 +1,15 @@
+2016-05-24  Conrad Shultz  <[email protected]>
+
+        _WKThumbnailView should expose its snapshot size
+        https://bugs.webkit.org/show_bug.cgi?id=158049
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/_WKThumbnailView.h:
+        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
+        (-[_WKThumbnailView _didTakeSnapshot:]):
+        Update the new snapshotSize property in a KVO-compliant manner.
+
 2016-05-24  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r201349.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.h (201365 => 201366)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.h	2016-05-25 00:45:14 UTC (rev 201365)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.h	2016-05-25 00:46:20 UTC (rev 201366)
@@ -39,6 +39,7 @@
 - (instancetype)initWithFrame:(NSRect)frame fromWKView:(WKView *)wkView;
 
 @property (nonatomic) CGFloat scale;
+@property (nonatomic, readonly) CGSize snapshotSize;
 @property (nonatomic) BOOL exclusivelyUsesSnapshot;
 
 // This should be removed when all clients go away; it is always YES now.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm (201365 => 201366)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm	2016-05-25 00:45:14 UTC (rev 201365)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm	2016-05-25 00:46:20 UTC (rev 201366)
@@ -56,6 +56,7 @@
     double _lastSnapshotScale;
 }
 
+@synthesize snapshotSize=_snapshotSize;
 @synthesize _waitingForSnapshot=_waitingForSnapshot;
 @synthesize exclusivelyUsesSnapshot=_exclusivelyUsesSnapshot;
 
@@ -138,6 +139,9 @@
 
 - (void)_didTakeSnapshot:(CGImageRef)image
 {
+    [self willChangeValueForKey:@"snapshotSize"];
+
+    _snapshotSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image));
     _waitingForSnapshot = NO;
     self.layer.sublayers = @[];
     self.layer.contentsGravity = kCAGravityResizeAspectFill;
@@ -148,6 +152,8 @@
         _snapshotWasDeferred = NO;
         [self _requestSnapshotIfNeeded];
     }
+
+    [self didChangeValueForKey:@"snapshotSize"];
 }
 
 - (void)viewDidMoveToWindow
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to