Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (192551 => 192552)
--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-11-18 00:23:56 UTC (rev 192551)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-11-18 00:26:54 UTC (rev 192552)
@@ -1,23 +1,7 @@
-2015-11-16 Matthew Hanson <matthew_han...@apple.com>
+2015-11-13 Matthew Hanson <matthew_han...@apple.com>
- Merge r192284. rdar://problem/22846841
+ Rollout r192501. rdar://problem/22846841
- 2015-11-10 Simon Fraser <simon.fra...@apple.com>
-
- Use different pixel formats for displays that support them
- https://bugs.webkit.org/show_bug.cgi?id=151122
- rdar://problem/22846841
-
- Reviewed by Tim Horton.
-
- Add new IOSurface format enum values, and set up the appropriate IOSurfaceCreate()
- property dictionaries for them.
-
- * platform/graphics/cocoa/IOSurface.h:
- * platform/graphics/cocoa/IOSurface.mm:
- (IOSurface::IOSurface):
- * platform/spi/cocoa/IOSurfaceSPI.h:
-
2015-11-16 Matthew Hanson <matthew_han...@apple.com>
Merge r192138. rdar://problem/22846841
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.h (192551 => 192552)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2015-11-18 00:23:56 UTC (rev 192551)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2015-11-18 00:26:54 UTC (rev 192552)
@@ -41,9 +41,7 @@
enum class Format {
RGBA,
#if PLATFORM(IOS)
- YUV422,
- RGB10,
- RGB10A8,
+ YUV422
#endif
};
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (192551 => 192552)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2015-11-18 00:23:56 UTC (rev 192551)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2015-11-18 00:26:54 UTC (rev 192552)
@@ -102,115 +102,44 @@
, m_size(size)
, m_contextSize(size)
{
+ unsigned pixelFormat = 'BGRA';
+ unsigned bytesPerPixel = 4;
+ unsigned bytesPerElement = 4;
+ unsigned elementWidth = 1;
- unsigned pixelFormat;
- unsigned bytesPerPixel;
- unsigned bytesPerElement;
+#if PLATFORM(IOS)
+ if (format == Format::YUV422) {
+ pixelFormat = 'yuvf';
+ bytesPerPixel = 2;
+ elementWidth = 2;
+ bytesPerElement = 4;
+ }
+#endif
int width = size.width();
int height = size.height();
- NSDictionary *options;
-
- if (format == Format::RGB10A8) {
- pixelFormat = 'b3a8';
-
- // RGB plane (10-10-10)
- bytesPerPixel = 4;
- bytesPerElement = 4;
+ size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerPixel);
+ ASSERT(bytesPerRow);
- size_t rgbPlaneBytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
- size_t rgbPlaneTotalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * rgbPlaneBytesPerRow);
+ m_totalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
+ ASSERT(m_totalBytes);
- // Alpha plane (8)
- bytesPerElement = 1;
- size_t alphaPlaneBytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
- size_t alphaPlaneTotalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * alphaPlaneBytesPerRow);
-
- m_totalBytes = rgbPlaneTotalBytes + alphaPlaneTotalBytes;
-
- NSArray *planeInfo = @[
- @{
- (id)kIOSurfacePlaneWidth: @(width),
- (id)kIOSurfacePlaneHeight: @(height),
- (id)kIOSurfacePlaneBytesPerRow: @(rgbPlaneBytesPerRow),
- (id)kIOSurfacePlaneOffset: @(0),
- (id)kIOSurfacePlaneSize: @(rgbPlaneTotalBytes)
- },
- @{
- (id)kIOSurfacePlaneWidth: @(width),
- (id)kIOSurfacePlaneHeight: @(height),
- (id)kIOSurfacePlaneBytesPerRow: @(alphaPlaneBytesPerRow),
- (id)kIOSurfacePlaneOffset: @(rgbPlaneTotalBytes),
- (id)kIOSurfacePlaneSize: @(alphaPlaneTotalBytes)
- }
- ];
-
- options = @{
- (id)kIOSurfaceWidth: @(width),
- (id)kIOSurfaceHeight: @(height),
- (id)kIOSurfacePixelFormat: @(pixelFormat),
- (id)kIOSurfaceAllocSize: @(m_totalBytes),
+ NSDictionary *options = @{
+ (id)kIOSurfaceWidth: @(width),
+ (id)kIOSurfaceHeight: @(height),
+ (id)kIOSurfacePixelFormat: @(pixelFormat),
+ (id)kIOSurfaceBytesPerElement: @(bytesPerElement),
+ (id)kIOSurfaceBytesPerRow: @(bytesPerRow),
+ (id)kIOSurfaceAllocSize: @(m_totalBytes),
#if PLATFORM(IOS)
- (id)kIOSurfaceCacheMode: @(kIOMapWriteCombineCache),
+ (id)kIOSurfaceCacheMode: @(kIOMapWriteCombineCache),
#endif
- (id)kIOSurfacePlaneInfo: planeInfo,
- };
- } else {
- unsigned elementWidth;
+ (id)kIOSurfaceElementWidth: @(elementWidth),
+ (id)kIOSurfaceElementHeight: @(1)
+ };
- switch (format) {
- case Format::RGBA:
- pixelFormat = 'BGRA';
- bytesPerPixel = 4;
- bytesPerElement = 4;
- elementWidth = 1;
- break;
- case Format::YUV422:
- pixelFormat = 'yuvf';
- bytesPerPixel = 2;
- bytesPerElement = 4;
- elementWidth = 2;
- break;
- case Format::RGB10:
- pixelFormat = 'w30r';
- bytesPerPixel = 4;
- bytesPerElement = 4;
- elementWidth = 1;
- break;
- case Format::RGB10A8:
- ASSERT_NOT_REACHED();
- pixelFormat = 'b3a8';
- bytesPerPixel = 1;
- bytesPerElement = 1;
- elementWidth = 1;
- break;
- }
-
- size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerPixel);
- ASSERT(bytesPerRow);
-
- m_totalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
- ASSERT(m_totalBytes);
-
- options = @{
- (id)kIOSurfaceWidth: @(width),
- (id)kIOSurfaceHeight: @(height),
- (id)kIOSurfacePixelFormat: @(pixelFormat),
- (id)kIOSurfaceBytesPerElement: @(bytesPerElement),
- (id)kIOSurfaceBytesPerRow: @(bytesPerRow),
- (id)kIOSurfaceAllocSize: @(m_totalBytes),
-#if PLATFORM(IOS)
- (id)kIOSurfaceCacheMode: @(kIOMapWriteCombineCache),
-#endif
- (id)kIOSurfaceElementWidth: @(elementWidth),
- (id)kIOSurfaceElementHeight: @(1)
- };
- }
-
m_surface = adoptCF(IOSurfaceCreate((CFDictionaryRef)options));
- if (!m_surface)
- NSLog(@"Surface creation failed for options %@", options);
}
IOSurface::IOSurface(IntSize size, IntSize contextSize, ColorSpace colorSpace)
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h (192551 => 192552)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h 2015-11-18 00:23:56 UTC (rev 192551)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h 2015-11-18 00:26:54 UTC (rev 192552)
@@ -56,12 +56,6 @@
extern const CFStringRef kIOSurfaceHeight;
extern const CFStringRef kIOSurfacePixelFormat;
extern const CFStringRef kIOSurfaceWidth;
-extern const CFStringRef kIOSurfacePlaneWidth;
-extern const CFStringRef kIOSurfacePlaneHeight;
-extern const CFStringRef kIOSurfacePlaneBytesPerRow;
-extern const CFStringRef kIOSurfacePlaneOffset;
-extern const CFStringRef kIOSurfacePlaneSize;
-extern const CFStringRef kIOSurfacePlaneInfo;
size_t IOSurfaceAlignProperty(CFStringRef property, size_t value);
IOSurfaceRef IOSurfaceCreate(CFDictionaryRef properties);
Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (192551 => 192552)
--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-11-18 00:23:56 UTC (rev 192551)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-11-18 00:26:54 UTC (rev 192552)
@@ -1,22 +1,7 @@
-2015-11-16 Matthew Hanson <matthew_han...@apple.com>
+2015-11-13 Matthew Hanson <matthew_han...@apple.com>
- Merge r192284. rdar://problem/22846841
+ Rollout r192501. rdar://problem/22846841
- 2015-11-10 Simon Fraser <simon.fra...@apple.com>
-
- Use different pixel formats for displays that support them
- https://bugs.webkit.org/show_bug.cgi?id=151122
- rdar://problem/22846841
-
- Reviewed by Tim Horton.
-
- New the new IOSurface formats when appropriate for the properties of the
- display.
-
- * Shared/mac/RemoteLayerBackingStore.mm:
- (WebKit::bufferFormat):
- (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
-
2015-11-16 Matthew Hanson <matthew_han...@apple.com>
Merge r191895. rdar://problem/23501902
Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (192551 => 192552)
--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2015-11-18 00:23:56 UTC (rev 192551)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2015-11-18 00:26:54 UTC (rev 192552)
@@ -45,23 +45,6 @@
#import <mach/mach_port.h>
#endif
-#if __has_include(<WebKitAdditions/RemoteLayerBackingStoreAdditions.mm>)
-#import <WebKitAdditions/RemoteLayerBackingStoreAdditions.mm>
-#else
-
-namespace WebKit {
-
-#if USE(IOSURFACE)
-static WebCore::IOSurface::Format bufferFormat(bool)
-{
- return WebCore::IOSurface::Format::RGBA;
-}
-#endif // USE(IOSURFACE)
-
-} // namespace WebKit
-
-#endif
-
using namespace WebCore;
namespace WebKit {
@@ -203,9 +186,10 @@
std::swap(m_frontBuffer, m_backBuffer);
if (!m_frontBuffer.surface)
- m_frontBuffer.surface = IOSurface::create(expandedScaledSize, ColorSpaceSRGB, bufferFormat(m_isOpaque));
+ m_frontBuffer.surface = IOSurface::create(expandedScaledSize, ColorSpaceSRGB);
setBufferVolatility(BufferType::Front, false);
+
return;
}
#endif