Title: [234174] branches/safari-606-branch/Tools
Revision
234174
Author
[email protected]
Date
2018-07-24 15:20:05 -0700 (Tue, 24 Jul 2018)

Log Message

Cherry-pick r234115. rdar://problem/42557644

    DRT relies on [webView display] to call -viewWillDraw on the WebHTMLView
    https://bugs.webkit.org/show_bug.cgi?id=187924
    <rdar://problem/41745884>

    Reviewed by Simon Fraser.

    WebKit relies on -viewWillDraw getting called on WebHTMLView, even though that view has not been marked as needing display.

    * DumpRenderTree/mac/PixelDumpSupportMac.mm:
    (createBitmapContextFromWebView):

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

Modified Paths

Diff

Modified: branches/safari-606-branch/Tools/ChangeLog (234173 => 234174)


--- branches/safari-606-branch/Tools/ChangeLog	2018-07-24 21:50:00 UTC (rev 234173)
+++ branches/safari-606-branch/Tools/ChangeLog	2018-07-24 22:20:05 UTC (rev 234174)
@@ -1,3 +1,34 @@
+2018-07-24  Ryan Haddad  <[email protected]>
+
+        Cherry-pick r234115. rdar://problem/42557644
+
+    DRT relies on [webView display] to call -viewWillDraw on the WebHTMLView
+    https://bugs.webkit.org/show_bug.cgi?id=187924
+    <rdar://problem/41745884>
+    
+    Reviewed by Simon Fraser.
+    
+    WebKit relies on -viewWillDraw getting called on WebHTMLView, even though that view has not been marked as needing display.
+    
+    * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+    (createBitmapContextFromWebView):
+    
+    
+    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@234115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-23  Zalan Bujtas  <[email protected]>
+
+            DRT relies on [webView display] to call -viewWillDraw on the WebHTMLView
+            https://bugs.webkit.org/show_bug.cgi?id=187924
+            <rdar://problem/41745884>
+
+            Reviewed by Simon Fraser.
+
+            WebKit relies on -viewWillDraw getting called on WebHTMLView, even though that view has not been marked as needing display.
+
+            * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+            (createBitmapContextFromWebView):
+
 2018-07-20  Babak Shafiei  <[email protected]>
 
         Revert r233926. rdar://problem/42446531

Modified: branches/safari-606-branch/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm (234173 => 234174)


--- branches/safari-606-branch/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm	2018-07-24 21:50:00 UTC (rev 234173)
+++ branches/safari-606-branch/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm	2018-07-24 22:20:05 UTC (rev 234174)
@@ -49,6 +49,10 @@
 + (void)synchronize;
 @end
 
+@interface WebView ()
+- (BOOL)_flushCompositingChanges;
+@end
+
 static void paintRepaintRectOverlay(WebView* webView, CGContextRef context)
 {
     CGRect viewRect = NSRectToCGRect([webView bounds]);
@@ -87,10 +91,6 @@
     if ([view _isUsingAcceleratedCompositing])
         _onscreen_ = YES;
 
-    // If the window is layer-backed, its backing store will be empty, so we have to use a window server snapshot.
-    if ([view.window.contentView layer])
-        _onscreen_ = YES;
-
     float deviceScaleFactor = [view _backingScaleFactor];
     NSSize webViewSize = [view frame].size;
     size_t pixelsWide = static_cast<size_t>(webViewSize.width * deviceScaleFactor);
@@ -122,6 +122,7 @@
             // FIXME: This will break repaint testing if we have compositing in repaint tests.
             // (displayWebView() painted gray over the webview, but we'll be making everything repaint again).
             [view display];
+            [view _flushCompositingChanges];
             [CATransaction flush];
             [CATransaction synchronize];
 
@@ -133,30 +134,12 @@
 
             if ([view isTrackingRepaints])
                 paintRepaintRectOverlay(view, context);
-        } else if (deviceScaleFactor != 1) {
+        } else {
             // Call displayRectIgnoringOpacity for HiDPI tests since it ensures we paint directly into the context
             // that we have appropriately sized and scaled.
             [view displayRectIgnoringOpacity:[view bounds] inContext:nsContext];
             if ([view isTrackingRepaints])
                 paintRepaintRectOverlay(view, context);
-        } else {
-            // Make sure the view has been painted.
-            [view displayIfNeeded];
-
-            // Grab directly the contents of the window backing buffer (this ignores any surfaces on the window)
-            // FIXME: This path is suboptimal: data is read from window backing store, converted to RGB8 then drawn again into an RGBA8 bitmap
-            [view lockFocus];
-            NSBitmapImageRep *imageRep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:[view frame]] autorelease];
-            [view unlockFocus];
-
-            RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext];
-            [NSGraphicsContext setCurrentContext:nsContext];
-            [imageRep draw];
-            
-            if ([view isTrackingRepaints])
-                paintRepaintRectOverlay(view, context);
-            
-            [NSGraphicsContext setCurrentContext:savedContext.get()];
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to