Changeset 192552 in webkit


Ignore:
Timestamp:
Nov 17, 2015 4:26:54 PM (8 years ago)
Author:
matthew_hanson@apple.com
Message:

Rollout r192501. rdar://problem/22846841

Location:
branches/safari-601.1.46-branch/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601.1.46-branch/Source/WebCore/ChangeLog

    r192501 r192552  
    1 2015-11-16  Matthew Hanson  <matthew_hanson@apple.com>
    2 
    3         Merge r192284. rdar://problem/22846841
    4 
    5     2015-11-10  Simon Fraser  <simon.fraser@apple.com>
    6 
    7             Use different pixel formats for displays that support them
    8             https://bugs.webkit.org/show_bug.cgi?id=151122
    9             rdar://problem/22846841
    10 
    11             Reviewed by Tim Horton.
    12 
    13             Add new IOSurface format enum values, and set up the appropriate IOSurfaceCreate()
    14             property dictionaries for them.
    15 
    16             * platform/graphics/cocoa/IOSurface.h:
    17             * platform/graphics/cocoa/IOSurface.mm:
    18             (IOSurface::IOSurface):
    19             * platform/spi/cocoa/IOSurfaceSPI.h:
     12015-11-13  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Rollout r192501. rdar://problem/22846841
    204
    2152015-11-16  Matthew Hanson  <matthew_hanson@apple.com>
  • branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.h

    r192501 r192552  
    4242        RGBA,
    4343#if PLATFORM(IOS)
    44         YUV422,
    45         RGB10,
    46         RGB10A8,
     44        YUV422
    4745#endif
    4846    };
  • branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.mm

    r192501 r192552  
    103103    , m_contextSize(size)
    104104{
    105 
    106     unsigned pixelFormat;
    107     unsigned bytesPerPixel;
    108     unsigned bytesPerElement;
     105    unsigned pixelFormat = 'BGRA';
     106    unsigned bytesPerPixel = 4;
     107    unsigned bytesPerElement = 4;
     108    unsigned elementWidth = 1;
     109
     110#if PLATFORM(IOS)
     111    if (format == Format::YUV422) {
     112        pixelFormat = 'yuvf';
     113        bytesPerPixel = 2;
     114        elementWidth = 2;
     115        bytesPerElement = 4;
     116    }
     117#endif
    109118
    110119    int width = size.width();
    111120    int height = size.height();
    112121
    113     NSDictionary *options;
    114    
    115     if (format == Format::RGB10A8) {
    116         pixelFormat = 'b3a8';
    117        
    118         // RGB plane (10-10-10)
    119         bytesPerPixel = 4;
    120         bytesPerElement = 4;
    121 
    122         size_t rgbPlaneBytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
    123         size_t rgbPlaneTotalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * rgbPlaneBytesPerRow);
    124 
    125         // Alpha plane (8)
    126         bytesPerElement = 1;
    127         size_t alphaPlaneBytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
    128         size_t alphaPlaneTotalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * alphaPlaneBytesPerRow);
    129        
    130         m_totalBytes = rgbPlaneTotalBytes + alphaPlaneTotalBytes;
    131 
    132         NSArray *planeInfo = @[
    133             @{
    134                 (id)kIOSurfacePlaneWidth: @(width),
    135                 (id)kIOSurfacePlaneHeight: @(height),
    136                 (id)kIOSurfacePlaneBytesPerRow: @(rgbPlaneBytesPerRow),
    137                 (id)kIOSurfacePlaneOffset: @(0),
    138                 (id)kIOSurfacePlaneSize: @(rgbPlaneTotalBytes)
    139             },
    140             @{
    141                 (id)kIOSurfacePlaneWidth: @(width),
    142                 (id)kIOSurfacePlaneHeight: @(height),
    143                 (id)kIOSurfacePlaneBytesPerRow: @(alphaPlaneBytesPerRow),
    144                 (id)kIOSurfacePlaneOffset: @(rgbPlaneTotalBytes),
    145                 (id)kIOSurfacePlaneSize: @(alphaPlaneTotalBytes)
    146             }
    147         ];
    148 
    149         options = @{
    150             (id)kIOSurfaceWidth: @(width),
    151             (id)kIOSurfaceHeight: @(height),
    152             (id)kIOSurfacePixelFormat: @(pixelFormat),
    153             (id)kIOSurfaceAllocSize: @(m_totalBytes),
     122    size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerPixel);
     123    ASSERT(bytesPerRow);
     124
     125    m_totalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
     126    ASSERT(m_totalBytes);
     127
     128    NSDictionary *options = @{
     129        (id)kIOSurfaceWidth: @(width),
     130        (id)kIOSurfaceHeight: @(height),
     131        (id)kIOSurfacePixelFormat: @(pixelFormat),
     132        (id)kIOSurfaceBytesPerElement: @(bytesPerElement),
     133        (id)kIOSurfaceBytesPerRow: @(bytesPerRow),
     134        (id)kIOSurfaceAllocSize: @(m_totalBytes),
    154135#if PLATFORM(IOS)
    155             (id)kIOSurfaceCacheMode: @(kIOMapWriteCombineCache),
     136        (id)kIOSurfaceCacheMode: @(kIOMapWriteCombineCache),
    156137#endif
    157             (id)kIOSurfacePlaneInfo: planeInfo,
    158         };
    159     } else {
    160         unsigned elementWidth;
    161 
    162         switch (format) {
    163         case Format::RGBA:
    164             pixelFormat = 'BGRA';
    165             bytesPerPixel = 4;
    166             bytesPerElement = 4;
    167             elementWidth = 1;
    168             break;
    169         case Format::YUV422:
    170             pixelFormat = 'yuvf';
    171             bytesPerPixel = 2;
    172             bytesPerElement = 4;
    173             elementWidth = 2;
    174             break;
    175         case Format::RGB10:
    176             pixelFormat = 'w30r';
    177             bytesPerPixel = 4;
    178             bytesPerElement = 4;
    179             elementWidth = 1;
    180             break;
    181         case Format::RGB10A8:
    182             ASSERT_NOT_REACHED();
    183             pixelFormat = 'b3a8';
    184             bytesPerPixel = 1;
    185             bytesPerElement = 1;
    186             elementWidth = 1;
    187             break;
    188         }
    189 
    190         size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerPixel);
    191         ASSERT(bytesPerRow);
    192 
    193         m_totalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
    194         ASSERT(m_totalBytes);
    195 
    196         options = @{
    197             (id)kIOSurfaceWidth: @(width),
    198             (id)kIOSurfaceHeight: @(height),
    199             (id)kIOSurfacePixelFormat: @(pixelFormat),
    200             (id)kIOSurfaceBytesPerElement: @(bytesPerElement),
    201             (id)kIOSurfaceBytesPerRow: @(bytesPerRow),
    202             (id)kIOSurfaceAllocSize: @(m_totalBytes),
    203 #if PLATFORM(IOS)
    204             (id)kIOSurfaceCacheMode: @(kIOMapWriteCombineCache),
    205 #endif
    206             (id)kIOSurfaceElementWidth: @(elementWidth),
    207             (id)kIOSurfaceElementHeight: @(1)
    208         };
    209     }
    210    
     138        (id)kIOSurfaceElementWidth: @(elementWidth),
     139        (id)kIOSurfaceElementHeight: @(1)
     140    };
     141
    211142    m_surface = adoptCF(IOSurfaceCreate((CFDictionaryRef)options));
    212     if (!m_surface)
    213         NSLog(@"Surface creation failed for options %@", options);
    214143}
    215144
  • branches/safari-601.1.46-branch/Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h

    r192501 r192552  
    5757extern const CFStringRef kIOSurfacePixelFormat;
    5858extern const CFStringRef kIOSurfaceWidth;
    59 extern const CFStringRef kIOSurfacePlaneWidth;
    60 extern const CFStringRef kIOSurfacePlaneHeight;
    61 extern const CFStringRef kIOSurfacePlaneBytesPerRow;
    62 extern const CFStringRef kIOSurfacePlaneOffset;
    63 extern const CFStringRef kIOSurfacePlaneSize;
    64 extern const CFStringRef kIOSurfacePlaneInfo;
    6559
    6660size_t IOSurfaceAlignProperty(CFStringRef property, size_t value);
  • branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog

    r192501 r192552  
    1 2015-11-16  Matthew Hanson  <matthew_hanson@apple.com>
    2 
    3         Merge r192284. rdar://problem/22846841
    4 
    5     2015-11-10  Simon Fraser  <simon.fraser@apple.com>
    6 
    7             Use different pixel formats for displays that support them
    8             https://bugs.webkit.org/show_bug.cgi?id=151122
    9             rdar://problem/22846841
    10 
    11             Reviewed by Tim Horton.
    12 
    13             New the new IOSurface formats when appropriate for the properties of the
    14             display.
    15 
    16             * Shared/mac/RemoteLayerBackingStore.mm:
    17             (WebKit::bufferFormat):
    18             (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
     12015-11-13  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Rollout r192501. rdar://problem/22846841
    194
    2052015-11-16  Matthew Hanson  <matthew_hanson@apple.com>
  • branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm

    r192501 r192552  
    4646#endif
    4747
    48 #if __has_include(<WebKitAdditions/RemoteLayerBackingStoreAdditions.mm>)
    49 #import <WebKitAdditions/RemoteLayerBackingStoreAdditions.mm>
    50 #else
    51 
    52 namespace WebKit {
    53 
    54 #if USE(IOSURFACE)
    55 static WebCore::IOSurface::Format bufferFormat(bool)
    56 {
    57     return WebCore::IOSurface::Format::RGBA;
    58 }
    59 #endif // USE(IOSURFACE)
    60 
    61 } // namespace WebKit
    62 
    63 #endif
    64 
    6548using namespace WebCore;
    6649
     
    204187
    205188        if (!m_frontBuffer.surface)
    206             m_frontBuffer.surface = IOSurface::create(expandedScaledSize, ColorSpaceSRGB, bufferFormat(m_isOpaque));
     189            m_frontBuffer.surface = IOSurface::create(expandedScaledSize, ColorSpaceSRGB);
    207190
    208191        setBufferVolatility(BufferType::Front, false);
     192
    209193        return;
    210194    }
Note: See TracChangeset for help on using the changeset viewer.