UI side compositing doesn't paint on Mac
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2018 15:07:40 +0000 (15:07 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2018 15:07:40 +0000 (15:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191908

Reviewed by Tim Horton.

Source/WebCore:

For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.

* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
(WebCore::IOSurface::format const):
(WebCore::operator<<):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::bytesPerPixel const):
(WebKit::RemoteLayerBackingStore::surfaceBufferFormat const):

These deep color formats are not supported on Mac.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/IOSurface.h
Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm

index ba5e44e..114c137 100644 (file)
@@ -1,3 +1,19 @@
+2018-11-23  Antti Koivisto  <antti@apple.com>
+
+        UI side compositing doesn't paint on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=191908
+
+        Reviewed by Tim Horton.
+
+        For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.
+
+        * platform/graphics/cocoa/IOSurface.h:
+        * platform/graphics/cocoa/IOSurface.mm:
+        (WebCore::IOSurface::IOSurface):
+        (WebCore::IOSurface::ensurePlatformContext):
+        (WebCore::IOSurface::format const):
+        (WebCore::operator<<):
+
 2018-11-23  Javier Fernandez  <jfernandez@igalia.com>
 
         [css-grid] Implement Baseline Alignment for grid items
index daf6e90..b54e550 100644 (file)
 #include "GraphicsContext.h"
 #include "IntSize.h"
 
+#if PLATFORM(IOS_FAMILY)
+#define HAVE_IOSURFACE_RGB10 1
+#endif
+
 namespace WTF {
 class MachSendRight;
 class TextStream;
@@ -50,8 +54,10 @@ public:
     enum class Format {
         RGBA,
         YUV422,
+#if HAVE(IOSURFACE_RGB10)
         RGB10,
         RGB10A8,
+#endif
     };
     
     class Locker {
index bf4bf86..5c733e3 100644 (file)
@@ -204,12 +204,14 @@ IOSurface::IOSurface(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpa
     case Format::RGBA:
         options = optionsFor32BitSurface(size, 'BGRA');
         break;
+#if HAVE(IOSURFACE_RGB10)
     case Format::RGB10:
         options = optionsFor32BitSurface(size, 'w30r');
         break;
     case Format::RGB10A8:
         options = optionsForBiplanarSurface(size, 'b3a8', 4, 1);
         break;
+#endif
     case Format::YUV422:
         options = optionsForBiplanarSurface(size, '422f', 1, 1);
         break;
@@ -287,6 +289,7 @@ CGContextRef IOSurface::ensurePlatformContext(const HostWindow* hostWindow)
     switch (format()) {
     case Format::RGBA:
         break;
+#if HAVE(IOSURFACE_RGB10)
     case Format::RGB10:
     case Format::RGB10A8:
         // A half-float format will be used if CG needs to read back the IOSurface contents,
@@ -295,6 +298,7 @@ CGContextRef IOSurface::ensurePlatformContext(const HostWindow* hostWindow)
         bitsPerPixel = 64;
         bitmapInfo = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder16Host | kCGBitmapFloatComponents;
         break;
+#endif
     case Format::YUV422:
         ASSERT_NOT_REACHED();
         break;
@@ -362,11 +366,13 @@ IOSurface::Format IOSurface::format() const
     if (pixelFormat == 'BGRA')
         return Format::RGBA;
 
+#if HAVE(IOSURFACE_RGB10)
     if (pixelFormat == 'w30r')
         return Format::RGB10;
 
     if (pixelFormat == 'b3a8')
         return Format::RGB10A8;
+#endif
 
     if (pixelFormat == '422f')
         return Format::YUV422;
@@ -404,8 +410,10 @@ void IOSurface::releaseGraphicsContext()
 
 bool IOSurface::allowConversionFromFormatToFormat(Format sourceFormat, Format destFormat)
 {
+#if HAVE(IOSURFACE_RGB10)
     if ((sourceFormat == Format::RGB10 || sourceFormat == Format::RGB10A8) && destFormat == Format::YUV422)
         return false;
+#endif
 
     return true;
 }
@@ -466,12 +474,14 @@ static TextStream& operator<<(TextStream& ts, IOSurface::Format format)
     case IOSurface::Format::YUV422:
         ts << "YUV422";
         break;
+#if HAVE(IOSURFACE_RGB10)
     case IOSurface::Format::RGB10:
         ts << "RGB10";
         break;
     case IOSurface::Format::RGB10A8:
         ts << "RGB10A8";
         break;
+#endif
     }
     return ts;
 }
index 729b528..c7157be 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-23  Antti Koivisto  <antti@apple.com>
+
+        UI side compositing doesn't paint on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=191908
+
+        Reviewed by Tim Horton.
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::bytesPerPixel const):
+        (WebKit::RemoteLayerBackingStore::surfaceBufferFormat const):
+
+        These deep color formats are not supported on Mac.
+
 2018-11-22  Chris Dumez  <cdumez@apple.com>
 
         Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
index c520fcb..5c494cd 100644 (file)
@@ -181,8 +181,10 @@ unsigned RemoteLayerBackingStore::bytesPerPixel() const
     switch (surfaceBufferFormat()) {
     case WebCore::IOSurface::Format::RGBA: return 4;
     case WebCore::IOSurface::Format::YUV422: return 2;
+#if HAVE(IOSURFACE_RGB10)
     case WebCore::IOSurface::Format::RGB10: return 4;
     case WebCore::IOSurface::Format::RGB10A8: return 5;
+#endif
     }
 #endif
     return 4;
@@ -500,8 +502,10 @@ void RemoteLayerBackingStore::Buffer::discard()
 #if HAVE(IOSURFACE)
 WebCore::IOSurface::Format RemoteLayerBackingStore::surfaceBufferFormat() const
 {
+#if HAVE(IOSURFACE_RGB10)
     if (m_deepColor)
         return m_isOpaque ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGB10A8;
+#endif
 
     return WebCore::IOSurface::Format::RGBA;
 }