Changeset 173297 in webkit


Ignore:
Timestamp:
Sep 4, 2014 5:55:10 PM (10 years ago)
Author:
Simon Fraser
Message:

Add some logging to help diagnose assertions in dumpWebViewAsPixelsAndCompareWithExpected() on bots
https://bugs.webkit.org/show_bug.cgi?id=136561

Reviewed by Tim Horton.

Log for calloc() and CGBitmapContextCreate() failures.

  • DumpRenderTree/mac/PixelDumpSupportMac.mm:

(createBitmapContext):
(createBitmapContextFromWebView):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r173296 r173297  
     12014-09-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add some logging to help diagnose assertions in dumpWebViewAsPixelsAndCompareWithExpected() on bots
     4        https://bugs.webkit.org/show_bug.cgi?id=136561
     5
     6        Reviewed by Tim Horton.
     7       
     8        Log for calloc() and CGBitmapContextCreate() failures.
     9
     10        * DumpRenderTree/mac/PixelDumpSupportMac.mm:
     11        (createBitmapContext):
     12        (createBitmapContextFromWebView):
     13
    1142014-09-04  Andy Estes  <aestes@apple.com>
    215
  • trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm

    r167691 r173297  
    5555
    5656    buffer = calloc(pixelsHigh, rowBytes);
    57     if (!buffer)
    58         return 0;
     57    if (!buffer) {
     58        WTFLogAlways("DumpRenderTree: calloc(%llu, %llu) failed\n", pixelsHigh, rowBytes);
     59        return nullptr;
     60    }
    5961   
    6062    // Creating this bitmap in the device color space prevents any color conversion when the image of the web view is drawn into it.
     
    6365    if (!context) {
    6466        free(buffer);
    65         return 0;
     67        WTFLogAlways("DumpRenderTree: CGBitmapContextCreate(%p, %llu, %llu, 8, %llu, %p, 0x%x) failed\n", buffer, pixelsHigh, pixelsWide, rowBytes, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
     68        return nullptr;
    6669    }
    6770
     
    116119    size_t pixelsHigh = static_cast<size_t>(webViewSize.height * deviceScaleFactor);
    117120    size_t rowBytes = 0;
    118     void* buffer = 0;
     121    void* buffer = nullptr;
    119122    RefPtr<BitmapContext> bitmapContext = createBitmapContext(pixelsWide, pixelsHigh, rowBytes, buffer);
    120123    if (!bitmapContext)
    121         return 0;
     124        return nullptr;
    122125    CGContextRef context = bitmapContext->cgContext();
    123126    // The final scaling gets doubled on the screen capture surface when we use the hidpi backingScaleFactor value for CTM.
Note: See TracChangeset for help on using the changeset viewer.