Title: [167687] trunk/Tools
Revision
167687
Author
timothy_hor...@apple.com
Date
2014-04-22 15:44:51 -0700 (Tue, 22 Apr 2014)

Log Message

DumpRenderTree generates white snapshots on some platforms
https://bugs.webkit.org/show_bug.cgi?id=132026
<rdar://problem/16679363>

Reviewed by Simon Fraser.

* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
Link DRT against QuartzCore.

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(createBitmapContextFromWebView):
Force CoreAnimation to synchronously update layers in a more explicit
way that doesn't depend on AppKit behavior. This is very similar to what
WebKitTestRunner does (indirectly) during its force repaint.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (167686 => 167687)


--- trunk/Tools/ChangeLog	2014-04-22 22:05:46 UTC (rev 167686)
+++ trunk/Tools/ChangeLog	2014-04-22 22:44:51 UTC (rev 167687)
@@ -1,3 +1,20 @@
+2014-04-22  Tim Horton  <timothy_hor...@apple.com>
+
+        DumpRenderTree generates white snapshots on some platforms
+        https://bugs.webkit.org/show_bug.cgi?id=132026
+        <rdar://problem/16679363>
+
+        Reviewed by Simon Fraser.
+
+        * DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
+        Link DRT against QuartzCore.
+
+        * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+        (createBitmapContextFromWebView):
+        Force CoreAnimation to synchronously update layers in a more explicit
+        way that doesn't depend on AppKit behavior. This is very similar to what
+        WebKitTestRunner does (indirectly) during its force repaint.
+
 2014-04-22  Brent Fulgham  <bfulg...@apple.com>
 
         [Win] Support Python 2.7 in Cygwin

Modified: trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig (167686 => 167687)


--- trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig	2014-04-22 22:05:46 UTC (rev 167686)
+++ trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig	2014-04-22 22:44:51 UTC (rev 167687)
@@ -24,7 +24,7 @@
 #include "BaseTarget.xcconfig"
 
 OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_$(PLATFORM_NAME));
-OTHER_LDFLAGS_macosx = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebCoreTestSupport -force_load $(BUILT_PRODUCTS_DIR)/libDumpRenderTree.a -framework Carbon -framework Cocoa -framework _javascript_Core -framework OpenGL -framework WebKit;
+OTHER_LDFLAGS_macosx = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebCoreTestSupport -force_load $(BUILT_PRODUCTS_DIR)/libDumpRenderTree.a -framework Carbon -framework Cocoa -framework _javascript_Core -framework OpenGL -framework QuartzCore -framework WebKit;
 LD_RUNPATH_SEARCH_PATHS = "@loader_path/.";
 PRODUCT_NAME = DumpRenderTree;
 EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));

Modified: trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm (167686 => 167687)


--- trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm	2014-04-22 22:05:46 UTC (rev 167686)
+++ trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm	2014-04-22 22:44:51 UTC (rev 167687)
@@ -28,15 +28,16 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "PixelDumpSupport.h"
-#include "PixelDumpSupportCG.h"
+#import "config.h"
+#import "PixelDumpSupport.h"
+#import "PixelDumpSupportCG.h"
 
-#include "DumpRenderTree.h" 
-#include "TestRunner.h"
-#include <CoreGraphics/CGBitmapContext.h>
-#include <wtf/Assertions.h>
-#include <wtf/RefPtr.h>
+#import "DumpRenderTree.h" 
+#import "TestRunner.h"
+#import <CoreGraphics/CGBitmapContext.h>
+#import <QuartzCore/QuartzCore.h>
+#import <wtf/Assertions.h>
+#import <wtf/RefPtr.h>
 
 #import <WebKit/WebCoreStatistics.h>
 #import <WebKit/WebDocumentPrivate.h>
@@ -44,6 +45,10 @@
 #import <WebKit/WebKit.h>
 #import <WebKit/WebViewPrivate.h>
 
+@interface CATransaction (Details)
++ (void)synchronize;
+@end
+
 static PassRefPtr<BitmapContext> createBitmapContext(size_t pixelsWide, size_t pixelsHigh, size_t& rowBytes, void*& buffer)
 {
     rowBytes = (4 * pixelsWide + 63) & ~63; // Use a multiple of 64 bytes to improve CG performance
@@ -129,12 +134,11 @@
         }
     } else {
       if (onscreen) {
-            // displayIfNeeded does not update the CA layers if the layer-hosting view was not marked as needing display, so
-            // we're at the mercy of CA's display-link callback to update layers in time. So we need to force a display of the view
-            // to get AppKit to update the CA layers synchronously.
-            // FIXME: this will break repaint testing if we have compositing in repaint tests
+            // 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];
+            [CATransaction flush];
+            [CATransaction synchronize];
 
             // Ask the window server to provide us a composited version of the *real* window content including surfaces (i.e. OpenGL content)
             // Note that the returned image might differ very slightly from the window backing because of dithering artifacts in the window server compositor.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to