Title: [195082] trunk/Source
Revision
195082
Author
[email protected]
Date
2016-01-14 16:14:14 -0800 (Thu, 14 Jan 2016)

Log Message

Remove workaround for rdar://problem/23623670
https://bugs.webkit.org/show_bug.cgi?id=153107
rdar://problem/23633319

Reviewed by Tim Horton.

Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.

Source/WebCore:

* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::ensurePlatformContext):
(IOSurface::copyToSurface): Deleted.

Source/WebKit2:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (195081 => 195082)


--- trunk/Source/WebCore/ChangeLog	2016-01-15 00:07:36 UTC (rev 195081)
+++ trunk/Source/WebCore/ChangeLog	2016-01-15 00:14:14 UTC (rev 195082)
@@ -1,3 +1,19 @@
+2016-01-14  Simon Fraser  <[email protected]>
+
+        Remove workaround for rdar://problem/23623670
+        https://bugs.webkit.org/show_bug.cgi?id=153107
+        rdar://problem/23633319
+
+        Reviewed by Tim Horton.
+
+        Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
+        back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
+
+        * platform/graphics/cocoa/IOSurface.h:
+        * platform/graphics/cocoa/IOSurface.mm:
+        (IOSurface::ensurePlatformContext):
+        (IOSurface::copyToSurface): Deleted.
+
 2016-01-14  Beth Dakin  <[email protected]>
 
         WK1 and WK2 should share more candidate request code

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (195081 => 195082)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2016-01-15 00:07:36 UTC (rev 195081)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2016-01-15 00:14:14 UTC (rev 195082)
@@ -94,7 +94,6 @@
     WEBCORE_EXPORT void releaseGraphicsContext();
 
 #if PLATFORM(IOS)
-    WEBCORE_EXPORT void copyToSurface(IOSurface&);
     WEBCORE_EXPORT static bool allowConversionFromFormatToFormat(Format, Format);
     WEBCORE_EXPORT static void convertToFormat(std::unique_ptr<WebCore::IOSurface>&& inSurface, Format, std::function<void(std::unique_ptr<WebCore::IOSurface>)>);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (195081 => 195082)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2016-01-15 00:07:36 UTC (rev 195081)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2016-01-15 00:14:14 UTC (rev 195082)
@@ -286,13 +286,12 @@
     case Format::RGBA:
         break;
     case Format::RGB10:
-        bitsPerComponent = 10;
-        bitsPerPixel = 32;
-        break;
     case Format::RGB10A8:
-        // FIXME: This doesn't take the two-plane format into account.
-        bitsPerComponent = 10;
-        bitsPerPixel = 32;
+        // A half-float format will be used if CG needs to read back the IOSurface contents,
+        // but for an IOSurface-to-IOSurface copy, there shoud be no conversion.
+        bitsPerComponent = 16;
+        bitsPerPixel = 64;
+        bitmapInfo = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder16Host | kCGBitmapFloatComponents;
         break;
     case Format::YUV422:
         ASSERT_NOT_REACHED();
@@ -374,27 +373,6 @@
 }
 
 #if PLATFORM(IOS)
-WEBCORE_EXPORT void IOSurface::copyToSurface(IOSurface& destSurface)
-{
-    if (destSurface.format() != format()) {
-        WTFLogAlways("Trying to copy IOSurface to another surface with a different format");
-        return;
-    }
-
-    if (destSurface.size() != size()) {
-        WTFLogAlways("Trying to copy IOSurface to another surface with a different size");
-        return;
-    }
-
-    static IOSurfaceAcceleratorRef accelerator;
-    if (!accelerator)
-        IOSurfaceAcceleratorCreate(nullptr, nullptr, &accelerator);
-
-    IOReturn ret = IOSurfaceAcceleratorTransformSurface(accelerator, m_surface.get(), destSurface.surface(), nullptr, nullptr, nullptr, nullptr, nullptr);
-    if (ret)
-        WTFLogAlways("IOSurfaceAcceleratorTransformSurface %p to %p failed with error %d", m_surface.get(), destSurface.surface(), ret);
-}
-
 bool IOSurface::allowConversionFromFormatToFormat(Format sourceFormat, Format destFormat)
 {
     if ((sourceFormat == Format::RGB10 || sourceFormat == Format::RGB10A8) && destFormat == Format::YUV422)

Modified: trunk/Source/WebKit2/ChangeLog (195081 => 195082)


--- trunk/Source/WebKit2/ChangeLog	2016-01-15 00:07:36 UTC (rev 195081)
+++ trunk/Source/WebKit2/ChangeLog	2016-01-15 00:14:14 UTC (rev 195082)
@@ -1,3 +1,17 @@
+2016-01-14  Simon Fraser  <[email protected]>
+
+        Remove workaround for rdar://problem/23623670
+        https://bugs.webkit.org/show_bug.cgi?id=153107
+        rdar://problem/23633319
+
+        Reviewed by Tim Horton.
+
+        Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
+        back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
+
+        * Shared/mac/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::display):
+
 2016-01-14  Beth Dakin  <[email protected]>
 
         WK1 and WK2 should share more candidate request code

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (195081 => 195082)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm	2016-01-15 00:07:36 UTC (rev 195081)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm	2016-01-15 00:14:14 UTC (rev 195082)
@@ -265,15 +265,8 @@
 #if USE(IOSURFACE)
     if (m_acceleratesDrawing) {
         RetainPtr<CGImageRef> backImage;
-        if (m_backBuffer.surface && !willPaintEntireBackingStore) {
-#if PLATFORM(IOS)
-            if (m_backBuffer.surface->format() == WebCore::IOSurface::Format::RGB10A8) {
-                // FIXME: remove this when rdar://problem/23623670 is fixed.
-                m_backBuffer.surface->copyToSurface(*m_frontBuffer.surface);
-            } else
-#endif
-                backImage = m_backBuffer.surface->createImage();
-        }
+        if (m_backBuffer.surface && !willPaintEntireBackingStore)
+            backImage = m_backBuffer.surface->createImage();
 
         GraphicsContext& context = m_frontBuffer.surface->ensureGraphicsContext();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to