[mac] Printing test snapshots are upside-down after r198242
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2016 21:31:18 +0000 (21:31 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2016 21:31:18 +0000 (21:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155543

Reviewed by Simon Fraser.

Source/WebCore:

* page/PrintContext.cpp:
(WebCore::PrintContext::spoolAllPagesWithBoundaries):
Stop PLATFORM(COCOA)-conditionally flipping here. Just paint.
This function is only used by the test runners so this doesn't have a
huge impact on anything else.

Tools:

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(createPagedBitmapContext):
Flip printing snapshots in DRT so that everything is right-side-up.

LayoutTests:

* TestExpectations:
Re-un-skip these tests.

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

LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/page/PrintContext.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm

index e5e51f8..a37b0d8 100644 (file)
@@ -1,3 +1,13 @@
+2016-03-16  Tim Horton  <timothy_horton@apple.com>
+
+        [mac] Printing test snapshots are upside-down after r198242
+        https://bugs.webkit.org/show_bug.cgi?id=155543
+
+        Reviewed by Simon Fraser.
+
+        * TestExpectations:
+        Re-un-skip these tests.
+
 2016-03-16  Ryan Haddad  <ryanhaddad@apple.com>
 
         Marking inspector/controller/runtime-controller.html as flaky on mac
index f2c6d34..97cac63 100644 (file)
@@ -897,10 +897,6 @@ fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure
 
 webkit.org/b/94458 http/tests/security/aboutBlank/security-context-write.html [ Skip ]
 
-webkit.org/b/155543 printing/quirks-percentage-height-body.html [ Skip ]
-webkit.org/b/155543 printing/quirks-percentage-height.html [ Skip ]
-webkit.org/b/155543 printing/standards-percentage-heights.html [ Skip ]
-
 ########################################
 ### START OF IndexedDB failures
 
index c34b8ab..e20dca3 100644 (file)
@@ -1,3 +1,16 @@
+2016-03-16  Tim Horton  <timothy_horton@apple.com>
+
+        [mac] Printing test snapshots are upside-down after r198242
+        https://bugs.webkit.org/show_bug.cgi?id=155543
+
+        Reviewed by Simon Fraser.
+
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::spoolAllPagesWithBoundaries):
+        Stop PLATFORM(COCOA)-conditionally flipping here. Just paint.
+        This function is only used by the test runners so this doesn't have a
+        huge impact on anything else.
+
 2016-03-16  Daniel Bates  <dabates@apple.com>
 
         Update WebKit Feature Status page to include the status of Content Security Policy Level 2 and Level 3
index 034689a..9614564 100644 (file)
@@ -341,10 +341,6 @@ void PrintContext::spoolAllPagesWithBoundaries(Frame& frame, GraphicsContext& gr
     graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
 
     graphicsContext.save();
-#if PLATFORM(COCOA)
-    graphicsContext.translate(0, totalHeight);
-    graphicsContext.scale(FloatSize(1, -1));
-#endif
 
     int currentHeight = 0;
     for (size_t pageIndex = 0; pageIndex < pageRects.size(); pageIndex++) {
index 566f453..9fd75e1 100644 (file)
@@ -1,3 +1,14 @@
+2016-03-16  Tim Horton  <timothy_horton@apple.com>
+
+        [mac] Printing test snapshots are upside-down after r198242
+        https://bugs.webkit.org/show_bug.cgi?id=155543
+
+        Reviewed by Simon Fraser.
+
+        * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+        (createPagedBitmapContext):
+        Flip printing snapshots in DRT so that everything is right-side-up.
+
 2016-03-16  Alexey Proskuryakov  <ap@apple.com>
 
         Update unit test for iOS debug queues.
index b78814e..e3334ef 100644 (file)
@@ -205,7 +205,12 @@ PassRefPtr<BitmapContext> createPagedBitmapContext()
     size_t rowBytes = 0;
     void* buffer = 0;
 
-    RefPtr<BitmapContext> bitmapContext = createBitmapContext(pageWidthInPixels, numberOfPages * (pageHeightInPixels + 1) - 1, rowBytes, buffer);
-    [mainFrame printToCGContext:bitmapContext->cgContext() pageWidth:pageWidthInPixels pageHeight:pageHeightInPixels];
+    int totalHeight = numberOfPages * (pageHeightInPixels + 1) - 1;
+
+    RefPtr<BitmapContext> bitmapContext = createBitmapContext(pageWidthInPixels, totalHeight, rowBytes, buffer);
+    CGContextRef context = bitmapContext->cgContext();
+    CGContextTranslateCTM(context, 0, totalHeight);
+    CGContextScaleCTM(context, 1, -1);
+    [mainFrame printToCGContext:context pageWidth:pageWidthInPixels pageHeight:pageHeightInPixels];
     return bitmapContext.release();
 }