Title: [232535] trunk/Source
Revision
232535
Author
[email protected]
Date
2018-06-05 21:35:12 -0700 (Tue, 05 Jun 2018)

Log Message

Move OpenGL display mask to screen data struct.
https://bugs.webkit.org/show_bug.cgi?id=186198
<rdar://problem/40724854>

Reviewed by Brent Fulgham.

Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
window is available, the OpenGL display mask of the main display is used.

Source/WebCore:

No new tests, since testing this requires two Web views in the same WebContent process, displayed on
two different monitors.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::allowOfflineRenderers const):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
(WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext):
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenProperties):
(WebCore::collectScreenProperties):
(WebCore::setScreenProperties):
(WebCore::screenData):
(WebCore::primaryOpenGLDisplayMask):
(WebCore::displayMaskForDisplay):
(WebCore::getScreenProperties):
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::screenPropertiesStateChanged):
(WebKit::displayReconfigurationCallBack):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setScreenProperties):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232534 => 232535)


--- trunk/Source/WebCore/ChangeLog	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/ChangeLog	2018-06-06 04:35:12 UTC (rev 232535)
@@ -1,3 +1,62 @@
+2018-06-05  Per Arne Vollan  <[email protected]>
+
+        Move OpenGL display mask to screen data struct.
+        https://bugs.webkit.org/show_bug.cgi?id=186198
+        <rdar://problem/40724854>
+
+        Reviewed by Brent Fulgham.
+
+        Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
+        it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
+        resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
+        display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
+        the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
+        window is available, the OpenGL display mask of the main display is used.
+
+        No new tests, since testing this requires two Web views in the same WebContent process, displayed on
+        two different monitors.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::createImageBuffer const):
+        * platform/PlatformScreen.h:
+        * platform/ScreenProperties.h:
+        (WebCore::ScreenProperties::encode const):
+        (WebCore::ScreenProperties::decode):
+        (WebCore::ScreenData::encode const):
+        (WebCore::ScreenData::decode):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/ImageBuffer.cpp:
+        (WebCore::ImageBuffer::create):
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::createCompatibleBuffer):
+        (WebCore::ImageBuffer::ImageBuffer):
+        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::allowOfflineRenderers const):
+        (WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
+        (WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
+        * platform/graphics/cocoa/IOSurface.h:
+        * platform/graphics/cocoa/IOSurface.mm:
+        (WebCore::IOSurface::ensurePlatformContext):
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::screenProperties):
+        (WebCore::collectScreenProperties):
+        (WebCore::setScreenProperties):
+        (WebCore::screenData):
+        (WebCore::primaryOpenGLDisplayMask):
+        (WebCore::displayMaskForDisplay):
+        (WebCore::getScreenProperties):
+        (WebCore::screenIsMonochrome):
+        (WebCore::screenHasInvertedColors):
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenRectForDisplay):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        (WebCore::screenColorSpace):
+        (WebCore::screenSupportsExtendedColor):
+
 2018-06-05  Jer Noble  <[email protected]>
 
         REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in

Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (232534 => 232535)


--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -913,7 +913,8 @@
 
     RenderingMode renderingMode = shouldAccelerate(size()) ? Accelerated : Unaccelerated;
 
-    setImageBuffer(ImageBuffer::create(size(), renderingMode));
+    auto hostWindow = (document().view() && document().view()->root()) ? document().view()->root()->hostWindow() : nullptr;
+    setImageBuffer(ImageBuffer::create(size(), renderingMode, 1, ColorSpaceSRGB, hostWindow));
     if (!m_imageBuffer)
         return;
     m_imageBuffer->context().setShadowsIgnoreTransforms(true);

Modified: trunk/Source/WebCore/platform/PlatformScreen.h (232534 => 232535)


--- trunk/Source/WebCore/platform/PlatformScreen.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/PlatformScreen.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -95,12 +95,11 @@
 
 NSPoint flipScreenPoint(const NSPoint&, NSScreen *);
 
-typedef HashMap<PlatformDisplayID, ScreenProperties> ScreenPropertiesMap;
+WEBCORE_EXPORT ScreenProperties collectScreenProperties();
+WEBCORE_EXPORT void setScreenProperties(const ScreenProperties&);
 
-WEBCORE_EXPORT std::pair<PlatformDisplayID, ScreenPropertiesMap> getScreenProperties();
-WEBCORE_EXPORT void setScreenProperties(PlatformDisplayID primaryScreenID, const ScreenPropertiesMap&);
-ScreenProperties screenProperties(PlatformDisplayID);
-
+uint32_t primaryOpenGLDisplayMask();
+uint32_t displayMaskForDisplay(PlatformDisplayID);
 #endif
 
 #if PLATFORM(IOS)

Modified: trunk/Source/WebCore/platform/ScreenProperties.h (232534 => 232535)


--- trunk/Source/WebCore/platform/ScreenProperties.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/ScreenProperties.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -28,6 +28,7 @@
 #if PLATFORM(MAC)
 
 #include "FloatRect.h"
+#include "PlatformScreen.h"
 #include <wtf/RetainPtr.h>
 #include <wtf/text/WTFString.h>
 
@@ -35,7 +36,7 @@
 
 namespace WebCore {
 
-struct ScreenProperties {
+struct ScreenData {
     FloatRect screenAvailableRect;
     FloatRect screenRect;
     RetainPtr<CGColorSpaceRef> colorSpace;
@@ -44,6 +45,7 @@
     bool screenSupportsExtendedColor { false };
     bool screenHasInvertedColors { false };
     bool screenIsMonochrome { false };
+    uint32_t displayMask { 0 };
 
     enum EncodedColorSpaceDataType {
         Null,
@@ -52,6 +54,16 @@
     };
 
     template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static std::optional<ScreenData> decode(Decoder&);
+};
+
+typedef HashMap<PlatformDisplayID, ScreenData> ScreenDataMap;
+    
+struct ScreenProperties {
+    PlatformDisplayID primaryDisplayID { 0 };
+    ScreenDataMap screenDataMap;
+
+    template<class Encoder> void encode(Encoder&) const;
     template<class Decoder> static std::optional<ScreenProperties> decode(Decoder&);
 };
 
@@ -58,8 +70,31 @@
 template<class Encoder>
 void ScreenProperties::encode(Encoder& encoder) const
 {
-    encoder << screenAvailableRect << screenRect << screenDepth << screenDepthPerComponent << screenSupportsExtendedColor << screenHasInvertedColors << screenIsMonochrome;
+    encoder << primaryDisplayID;
+    encoder << screenDataMap;
+}
 
+template<class Decoder>
+std::optional<ScreenProperties> ScreenProperties::decode(Decoder& decoder)
+{
+    std::optional<PlatformDisplayID> primaryDisplayID;
+    decoder >> primaryDisplayID;
+    if (!primaryDisplayID)
+        return std::nullopt;
+
+    std::optional<ScreenDataMap> screenDataMap;
+    decoder >> screenDataMap;
+    if (!screenDataMap)
+        return std::nullopt;
+
+    return { { *primaryDisplayID, WTFMove(*screenDataMap) } };
+}
+
+template<class Encoder>
+void ScreenData::encode(Encoder& encoder) const
+{
+    encoder << screenAvailableRect << screenRect << screenDepth << screenDepthPerComponent << screenSupportsExtendedColor << screenHasInvertedColors << screenIsMonochrome << displayMask;
+
     if (colorSpace) {
         // Try to encode the name.
         if (auto name = adoptCF(CGColorSpaceCopyName(colorSpace.get()))) {
@@ -85,7 +120,7 @@
 }
 
 template<class Decoder>
-std::optional<ScreenProperties> ScreenProperties::decode(Decoder& decoder)
+std::optional<ScreenData> ScreenData::decode(Decoder& decoder)
 {
     std::optional<FloatRect> screenAvailableRect;
     decoder >> screenAvailableRect;
@@ -122,6 +157,11 @@
     if (!screenIsMonochrome)
         return std::nullopt;
 
+    std::optional<uint32_t> displayMask;
+    decoder >> displayMask;
+    if (!displayMask)
+        return std::nullopt;
+    
     EncodedColorSpaceDataType dataType;
     if (!decoder.decodeEnum(dataType))
         return std::nullopt;
@@ -157,7 +197,7 @@
     }
     }
 
-    return { { WTFMove(*screenAvailableRect), WTFMove(*screenRect), WTFMove(cgColorSpace), WTFMove(*screenDepth), WTFMove(*screenDepthPerComponent), WTFMove(*screenSupportsExtendedColor), WTFMove(*screenHasInvertedColors), WTFMove(*screenIsMonochrome) } };
+    return { { WTFMove(*screenAvailableRect), WTFMove(*screenRect), WTFMove(cgColorSpace), WTFMove(*screenDepth), WTFMove(*screenDepthPerComponent), WTFMove(*screenSupportsExtendedColor), WTFMove(*screenHasInvertedColors), WTFMove(*screenIsMonochrome), WTFMove(*displayMask) } };
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (232534 => 232535)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -1282,11 +1282,6 @@
     GC3Denum currentBoundTarget() const { return m_state.currentBoundTarget(); }
     unsigned textureSeed(GC3Duint texture) { return m_state.textureSeedCount.count(texture); }
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    WEBCORE_EXPORT static void setOpenGLDisplayMask(CGOpenGLDisplayMask);
-    WEBCORE_EXPORT static CGOpenGLDisplayMask getOpenGLDisplayMask();
-#endif
-
 private:
     GraphicsContext3D(GraphicsContext3DAttributes, HostWindow*, RenderStyle = RenderOffscreen, GraphicsContext3D* sharedContext = nullptr);
 
@@ -1501,10 +1496,6 @@
 #if USE(CAIRO)
     Platform3DObject m_vao { 0 };
 #endif
-
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    static std::optional<CGOpenGLDisplayMask> m_displayMask;
-#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp (232534 => 232535)


--- trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -38,10 +38,10 @@
 static const float MaxClampedLength = 4096;
 static const float MaxClampedArea = MaxClampedLength * MaxClampedLength;
 
-std::unique_ptr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, ColorSpace colorSpace)
+std::unique_ptr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, ColorSpace colorSpace, const HostWindow* hostWindow)
 {
     bool success = false;
-    std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(size, resolutionScale, colorSpace, renderingMode, success));
+    std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(size, resolutionScale, colorSpace, renderingMode, hostWindow, success));
     if (!success)
         return nullptr;
     return buffer;

Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (232534 => 232535)


--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -49,7 +49,8 @@
 class ImageData;
 class IntPoint;
 class IntRect;
-
+class HostWindow;
+    
 enum BackingStoreCopy {
     CopyBackingStore, // Guarantee subsequent draws don't affect the copy.
     DontCopyBackingStore // Subsequent draws may affect the copy.
@@ -65,7 +66,7 @@
     friend class IOSurface;
 public:
     // Will return a null pointer on allocation failure.
-    WEBCORE_EXPORT static std::unique_ptr<ImageBuffer> create(const FloatSize&, RenderingMode, float resolutionScale = 1, ColorSpace = ColorSpaceSRGB);
+    WEBCORE_EXPORT static std::unique_ptr<ImageBuffer> create(const FloatSize&, RenderingMode, float resolutionScale = 1, ColorSpace = ColorSpaceSRGB, const HostWindow* = nullptr);
 #if USE(DIRECT2D)
     WEBCORE_EXPORT static std::unique_ptr<ImageBuffer> create(const FloatSize&, RenderingMode, const GraphicsContext*, float resolutionScale = 1, ColorSpace = ColorSpaceSRGB);
 #endif
@@ -164,9 +165,9 @@
 
     // This constructor will place its success into the given out-variable
     // so that create() knows when it should return failure.
-    WEBCORE_EXPORT ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success);
+    WEBCORE_EXPORT ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, const HostWindow*, bool& success);
 #if USE(CG)
-    ImageBuffer(const FloatSize&, float resolutionScale, CGColorSpaceRef, RenderingMode, bool& success);
+    ImageBuffer(const FloatSize&, float resolutionScale, CGColorSpaceRef, RenderingMode, const HostWindow*, bool& success);
     RetainPtr<CFDataRef> toCFData(const String& mimeType, std::optional<double> quality, PreserveResolution) const;
 #elif USE(DIRECT2D)
     ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, const GraphicsContext*, bool& success);

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (232534 => 232535)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -204,7 +204,7 @@
 }
 #endif
 
-ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace, RenderingMode renderingMode, bool& success)
+ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace, RenderingMode renderingMode, const HostWindow*, bool& success)
     : m_data(IntSize(size), renderingMode)
     , m_logicalSize(size)
     , m_resolutionScale(resolutionScale)

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (232534 => 232535)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -96,7 +96,7 @@
     RenderingMode renderingMode = context.renderingMode();
     IntSize scaledSize = ImageBuffer::compatibleBufferSize(size, context);
     bool success = false;
-    std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(scaledSize, 1, colorSpace.get(), renderingMode, success));
+    std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(scaledSize, 1, colorSpace.get(), renderingMode, nullptr, success));
 
     if (!success)
         return nullptr;
@@ -106,7 +106,7 @@
     return buffer;
 }
 
-ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, CGColorSpaceRef colorSpace, RenderingMode renderingMode, bool& success)
+ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, CGColorSpaceRef colorSpace, RenderingMode renderingMode, const HostWindow* hostWindow, bool& success)
     : m_logicalSize(size)
     , m_resolutionScale(resolutionScale)
 {
@@ -152,12 +152,14 @@
         FloatSize userBounds = sizeForDestinationSize(FloatSize(width.unsafeGet(), height.unsafeGet()));
         m_data.surface = IOSurface::create(m_data.backingStoreSize, IntSize(userBounds), colorSpace);
         if (m_data.surface) {
-            cgContext = m_data.surface->ensurePlatformContext();
+            cgContext = m_data.surface->ensurePlatformContext(hostWindow);
             if (cgContext)
                 CGContextClearRect(cgContext.get(), FloatRect(FloatPoint(), userBounds));
             else
                 m_data.surface = nullptr;
         }
+#else
+        UNUSED_PARAM(hostWindow);
 #endif
         if (!cgContext)
             accelerateRendering = false; // If allocation fails, fall back to non-accelerated path.
@@ -193,8 +195,8 @@
     success = true;
 }
 
-ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace imageColorSpace, RenderingMode renderingMode, bool& success)
-    : ImageBuffer(size, resolutionScale, cachedCGColorSpace(imageColorSpace), renderingMode, success)
+ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace imageColorSpace, RenderingMode renderingMode, const HostWindow* hostWindow, bool& success)
+    : ImageBuffer(size, resolutionScale, cachedCGColorSpace(imageColorSpace), renderingMode, hostWindow, success)
 {
 }
 

Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm (232534 => 232535)


--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm	2018-06-06 04:35:12 UTC (rev 232535)
@@ -36,6 +36,7 @@
 #import "Extensions3DOpenGL.h"
 #import "GraphicsContext.h"
 #import "HTMLCanvasElement.h"
+#import "HostWindow.h"
 #import "ImageBuffer.h"
 #import "Logging.h"
 #import "WebGLLayer.h"
@@ -60,14 +61,14 @@
 #import <OpenGL/gl.h>
 #endif
 
+#if PLATFORM(MAC)
+#import "ScreenProperties.h"
+#endif
+
 namespace WebCore {
 
 static const unsigned statusCheckThreshold = 5;
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-std::optional<CGOpenGLDisplayMask> GraphicsContext3D::m_displayMask;
-#endif
-
 #if HAVE(APPLE_GRAPHICS_CONTROL)
 
 enum {
@@ -424,7 +425,7 @@
 }
 #endif
 
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWindow*, GraphicsContext3D::RenderStyle, GraphicsContext3D* sharedContext)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle, GraphicsContext3D* sharedContext)
     : m_attrs(attrs)
 #if PLATFORM(IOS)
     , m_compiler(SH_ESSL_OUTPUT)
@@ -432,6 +433,7 @@
     , m_private(std::make_unique<GraphicsContext3DPrivate>(this))
 {
 #if USE(OPENGL_ES)
+    UNUSED_PARAM(hostWindow);
     EAGLRenderingAPI api = m_attrs.useGLES3 ? kEAGLRenderingAPIOpenGLES3 : kEAGLRenderingAPIOpenGLES2;
     if (!sharedContext)
         m_contextObj = [[EAGLContext alloc] initWithAPI:api];
@@ -492,8 +494,13 @@
     CGLSetParameter(m_contextObj, kCGLCPAbortOnGPURestartStatusBlacklisted, &abortOnBlacklist);
     
 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    if (m_displayMask.has_value())
-        identifyAndSetCurrentGPU(pixelFormatObj, numPixelFormats, m_displayMask.value(), m_contextObj);
+    if (auto displayMask = primaryOpenGLDisplayMask()) {
+        if (hostWindow && hostWindow->displayID())
+            displayMask = displayMaskForDisplay(hostWindow->displayID());
+        identifyAndSetCurrentGPU(pixelFormatObj, numPixelFormats, displayMask, m_contextObj);
+    }
+#else
+    UNUSED_PARAM(hostWindow);
 #endif
 
     CGLDestroyPixelFormat(pixelFormatObj);
@@ -789,20 +796,6 @@
     manager().updateAllContexts();
 }
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-void GraphicsContext3D::setOpenGLDisplayMask(CGOpenGLDisplayMask displayMask)
-{
-    m_displayMask = displayMask;
-}
-    
-CGOpenGLDisplayMask GraphicsContext3D::getOpenGLDisplayMask()
-{
-    if (m_displayMask.has_value())
-        return m_displayMask.value();
-    return 0;
-}
-#endif
-
 bool GraphicsContext3D::allowOfflineRenderers() const
 {
 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
@@ -812,7 +805,7 @@
     // all offline renderers need to be considered when finding a pixel format.
     // In WebKit legacy, there will still be a WindowServer connection, and
     // m_displayMask will not be set in this case.
-    if (m_displayMask.has_value())
+    if (primaryOpenGLDisplayMask())
         return true;
 #endif
         

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


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -38,6 +38,8 @@
 
 namespace WebCore {
 
+class HostWindow;
+    
 class IOSurface final {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -107,7 +109,7 @@
 #endif
     IOSurfaceRef surface() const { return m_surface.get(); }
     WEBCORE_EXPORT GraphicsContext& ensureGraphicsContext();
-    WEBCORE_EXPORT CGContextRef ensurePlatformContext();
+    WEBCORE_EXPORT CGContextRef ensurePlatformContext(const HostWindow* = nullptr);
 
     enum class SurfaceState {
         Valid,

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


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2018-06-06 04:35:12 UTC (rev 232535)
@@ -272,7 +272,7 @@
     m_contextSize = contextSize;
 }
 
-CGContextRef IOSurface::ensurePlatformContext()
+CGContextRef IOSurface::ensurePlatformContext(const HostWindow* hostWindow)
 {
     if (m_cgContext)
         return m_cgContext.get();
@@ -301,8 +301,13 @@
     m_cgContext = adoptCF(CGIOSurfaceContextCreate(m_surface.get(), m_contextSize.width(), m_contextSize.height(), bitsPerComponent, bitsPerPixel, m_colorSpace.get(), bitmapInfo));
 
 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    if (uint32_t mask = GraphicsContext3D::getOpenGLDisplayMask())
-        CGIOSurfaceContextSetDisplayMask(m_cgContext.get(), mask);
+    if (auto displayMask = primaryOpenGLDisplayMask()) {
+        if (hostWindow && hostWindow->displayID())
+            displayMask = displayMaskForDisplay(hostWindow->displayID());
+        CGIOSurfaceContextSetDisplayMask(m_cgContext.get(), displayMask);
+    }
+#else
+    UNUSED_PARAM(hostWindow);
 #endif
 
     return m_cgContext.get();

Modified: trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm (232534 => 232535)


--- trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm	2018-06-06 04:35:12 UTC (rev 232535)
@@ -96,9 +96,9 @@
     return screen(displayID(widget));
 }
 
-static ScreenPropertiesMap& screenProperties()
+static ScreenProperties& screenProperties()
 {
-    static NeverDestroyed<ScreenPropertiesMap> screenProperties;
+    static NeverDestroyed<ScreenProperties> screenProperties;
     return screenProperties;
 }
 
@@ -108,12 +108,11 @@
     return primaryScreenDisplayID;
 }
 
-std::pair<PlatformDisplayID, ScreenPropertiesMap> getScreenProperties()
+ScreenProperties collectScreenProperties()
 {
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
 
-    ScreenPropertiesMap screenProperties;
-    std::optional<PlatformDisplayID> firstScreen;
+    ScreenProperties screenProperties;
 
     for (NSScreen *screen in [NSScreen screens]) {
         auto displayID = WebCore::displayID(screen);
@@ -128,46 +127,63 @@
         bool screenSupportsExtendedColor = [screen canRepresentDisplayGamut:NSDisplayGamutP3];
         bool screenHasInvertedColors = CGDisplayUsesInvertedPolarity();
         bool screenIsMonochrome = CGDisplayUsesForceToGray();
+        uint32_t displayMask = CGDisplayIDToOpenGLDisplayMask(displayID);
 
-        screenProperties.set(displayID, ScreenProperties { screenAvailableRect, screenRect, colorSpace, screenDepth, screenDepthPerComponent, screenSupportsExtendedColor, screenHasInvertedColors, screenIsMonochrome });
+        screenProperties.screenDataMap.set(displayID, ScreenData { screenAvailableRect, screenRect, colorSpace, screenDepth, screenDepthPerComponent, screenSupportsExtendedColor, screenHasInvertedColors, screenIsMonochrome, displayMask });
 
-        if (!firstScreen)
-            firstScreen = displayID;
+        if (!screenProperties.primaryDisplayID)
+            screenProperties.primaryDisplayID = displayID;
     }
 
-    return { WTFMove(*firstScreen), WTFMove(screenProperties) };
+    return screenProperties;
 }
 
-void setScreenProperties(PlatformDisplayID primaryScreenID, const ScreenPropertiesMap& properties)
+void setScreenProperties(const ScreenProperties& properties)
 {
-    primaryScreenDisplayID() = primaryScreenID;
     screenProperties() = properties;
 }
 
-ScreenProperties screenProperties(PlatformDisplayID screendisplayID)
+static ScreenData screenData(PlatformDisplayID screendisplayID)
 {
-    RELEASE_ASSERT(!screenProperties().isEmpty());
+    RELEASE_ASSERT(!screenProperties().screenDataMap.isEmpty());
 
     // Return property of the first screen if the screen is not found in the map.
     auto displayID = screendisplayID ? screendisplayID : primaryScreenDisplayID();
     if (displayID) {
-        auto screenPropertiesForDisplay = screenProperties().find(displayID);
-        if (screenPropertiesForDisplay != screenProperties().end())
+        auto screenPropertiesForDisplay = screenProperties().screenDataMap.find(displayID);
+        if (screenPropertiesForDisplay != screenProperties().screenDataMap.end())
             return screenPropertiesForDisplay->value;
     }
 
     // Last resort: use the first item in the screen list.
-    return screenProperties().begin()->value;
+    return screenProperties().screenDataMap.begin()->value;
 }
 
-static ScreenProperties getScreenProperties(Widget* widget)
+uint32_t primaryOpenGLDisplayMask()
 {
-    return screenProperties(displayID(widget));
+    if (!screenProperties().screenDataMap.isEmpty())
+        return screenData(primaryScreenDisplayID()).displayMask;
+    
+    return 0;
 }
 
+uint32_t displayMaskForDisplay(PlatformDisplayID displayID)
+{
+    if (!screenProperties().screenDataMap.isEmpty())
+        return screenData(displayID).displayMask;
+    
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+static ScreenData getScreenProperties(Widget* widget)
+{
+    return screenData(displayID(widget));
+}
+
 bool screenIsMonochrome(Widget* widget)
 {
-    if (!screenProperties().isEmpty())
+    if (!screenProperties().screenDataMap.isEmpty())
         return getScreenProperties(widget).screenIsMonochrome;
 
     // This is a system-wide accessibility setting, same on all screens.
@@ -177,8 +193,8 @@
 
 bool screenHasInvertedColors()
 {
-    if (!screenProperties().isEmpty())
-        return screenProperties(primaryScreenDisplayID()).screenHasInvertedColors;
+    if (!screenProperties().screenDataMap.isEmpty())
+        return screenData(primaryScreenDisplayID()).screenHasInvertedColors;
 
     // This is a system-wide accessibility setting, same on all screens.
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
@@ -187,7 +203,7 @@
 
 int screenDepth(Widget* widget)
 {
-    if (!screenProperties().isEmpty()) {
+    if (!screenProperties().screenDataMap.isEmpty()) {
         auto screenDepth = getScreenProperties(widget).screenDepth;
         ASSERT(screenDepth);
         return screenDepth;
@@ -199,7 +215,7 @@
 
 int screenDepthPerComponent(Widget* widget)
 {
-    if (!screenProperties().isEmpty()) {
+    if (!screenProperties().screenDataMap.isEmpty()) {
         auto depthPerComponent = getScreenProperties(widget).screenDepthPerComponent;
         ASSERT(depthPerComponent);
         return depthPerComponent;
@@ -211,8 +227,8 @@
 
 FloatRect screenRectForDisplay(PlatformDisplayID displayID)
 {
-    if (!screenProperties().isEmpty()) {
-        auto screenRect = screenProperties(displayID).screenRect;
+    if (!screenProperties().screenDataMap.isEmpty()) {
+        auto screenRect = screenData(displayID).screenRect;
         ASSERT(!screenRect.isEmpty());
         return screenRect;
     }
@@ -228,7 +244,7 @@
 
 FloatRect screenRect(Widget* widget)
 {
-    if (!screenProperties().isEmpty())
+    if (!screenProperties().screenDataMap.isEmpty())
         return getScreenProperties(widget).screenRect;
 
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
@@ -237,7 +253,7 @@
 
 FloatRect screenAvailableRect(Widget* widget)
 {
-    if (!screenProperties().isEmpty())
+    if (!screenProperties().screenDataMap.isEmpty())
         return getScreenProperties(widget).screenAvailableRect;
 
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
@@ -262,7 +278,7 @@
 
 CGColorSpaceRef screenColorSpace(Widget* widget)
 {
-    if (!screenProperties().isEmpty())
+    if (!screenProperties().screenDataMap.isEmpty())
         return getScreenProperties(widget).colorSpace.get();
 
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
@@ -271,7 +287,7 @@
 
 bool screenSupportsExtendedColor(Widget* widget)
 {
-    if (!screenProperties().isEmpty())
+    if (!screenProperties().screenDataMap.isEmpty())
         return getScreenProperties(widget).screenSupportsExtendedColor;
 
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));

Modified: trunk/Source/WebKit/ChangeLog (232534 => 232535)


--- trunk/Source/WebKit/ChangeLog	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/ChangeLog	2018-06-06 04:35:12 UTC (rev 232535)
@@ -1,3 +1,47 @@
+2018-06-05  Per Arne Vollan  <[email protected]>
+
+        Move OpenGL display mask to screen data struct.
+        https://bugs.webkit.org/show_bug.cgi?id=186198
+        <rdar://problem/40724854>
+
+        Reviewed by Brent Fulgham.
+
+        Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
+        it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
+        resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
+        display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
+        the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
+        window is available, the OpenGL display mask of the main display is used.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode const):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::windowScreenDidChange):
+        (WebKit::WebPageProxy::creationParameters):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::screenPropertiesStateChanged):
+        (WebKit::displayReconfigurationCallBack):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_credentialsMessenger):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::setScreenProperties):
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2018-06-05  Keith Rollin  <[email protected]>
 
         Remove tracksResourceLoadMilestones support

Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp (232534 => 232535)


--- trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -119,9 +119,6 @@
 #if ENABLE(CONTENT_EXTENSIONS)
     encoder << contentRuleLists;
 #endif
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    encoder << displayMask;
-#endif
 }
 
 std::optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decoder& decoder)
@@ -346,11 +343,6 @@
     parameters.contentRuleLists = WTFMove(*contentRuleLists);
 #endif
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    if (!decoder.decode(parameters.displayMask))
-        return std::nullopt;
-#endif
-
     return WTFMove(parameters);
 }
 

Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.h (232534 => 232535)


--- trunk/Source/WebKit/Shared/WebPageCreationParameters.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -185,10 +185,6 @@
 #if ENABLE(CONTENT_EXTENSIONS)
     Vector<std::pair<String, WebCompiledContentRuleListData>> contentRuleLists;
 #endif
-    
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    CGOpenGLDisplayMask displayMask { 0 };
-#endif
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (232534 => 232535)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -156,8 +156,7 @@
 #endif
 
 #if PLATFORM(MAC)
-    encoder << primaryDisplayID;
-    encoder << screenPropertiesMap;
+    encoder << screenProperties;
 #endif
 }
 
@@ -407,14 +406,11 @@
 #endif
 
 #if PLATFORM(MAC)
-    if (!decoder.decode(parameters.primaryDisplayID))
+    std::optional<WebCore::ScreenProperties> screenProperties;
+    decoder >> screenProperties;
+    if (!screenProperties)
         return false;
-
-    std::optional<WebCore::ScreenPropertiesMap> screenPropertiesMap;
-    decoder >> screenPropertiesMap;
-    if (!screenPropertiesMap)
-        return false;
-    parameters.screenPropertiesMap = WTFMove(*screenPropertiesMap);
+    parameters.screenProperties = WTFMove(*screenProperties);
 #endif
 
     return true;

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (232534 => 232535)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -195,8 +195,7 @@
 #endif
 
 #if PLATFORM(MAC)
-    WebCore::PlatformDisplayID primaryDisplayID { 0 };
-    WebCore::ScreenPropertiesMap screenPropertiesMap;
+    WebCore::ScreenProperties screenProperties;
 #endif
 };
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (232534 => 232535)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-06-06 04:35:12 UTC (rev 232535)
@@ -282,9 +282,8 @@
 #endif
     
 #if PLATFORM(MAC)
-    auto screenProperties = WebCore::getScreenProperties();
-    parameters.primaryDisplayID = screenProperties.first;
-    parameters.screenPropertiesMap = WTFMove(screenProperties.second);
+    auto screenProperties = WebCore::collectScreenProperties();
+    parameters.screenProperties = WTFMove(screenProperties);
 #endif
 }
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (232534 => 232535)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -2778,11 +2778,6 @@
         return;
 
     m_process->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
-
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    auto currentDisplaymask = CGDisplayIDToOpenGLDisplayMask(displayID);
-    m_process->send(Messages::WebPage::OpenGLDisplayMaskChanged(currentDisplaymask), m_pageID);
-#endif
 }
 
 float WebPageProxy::deviceScaleFactor() const
@@ -6174,12 +6169,6 @@
     parameters.applicationManifest = m_configuration->applicationManifest() ? std::optional<WebCore::ApplicationManifest>(m_configuration->applicationManifest()->applicationManifest()) : std::nullopt;
 #endif
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    auto screen = WebCore::screen(m_pageClient.platformWindow());
-    auto displayID = WebCore::displayID(screen);
-    parameters.displayMask = CGDisplayIDToOpenGLDisplayMask(displayID);
-#endif
-
     m_process->addWebUserContentControllerProxy(m_userContentController, parameters);
 
     return parameters;

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (232534 => 232535)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -439,8 +439,8 @@
 void WebProcessPool::screenPropertiesStateChanged()
 {
 #if PLATFORM(MAC)
-    auto screenProperties = WebCore::getScreenProperties();
-    sendToAllProcesses(Messages::WebProcess::SetScreenProperties(screenProperties.first, screenProperties.second));
+    auto screenProperties = WebCore::collectScreenProperties();
+    sendToAllProcesses(Messages::WebProcess::SetScreenProperties(screenProperties));
 #endif
 }
 
@@ -810,9 +810,9 @@
 #if PLATFORM(MAC)
 static void displayReconfigurationCallBack(CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo)
 {
-    auto screenProperties = WebCore::getScreenProperties();
+    auto screenProperties = WebCore::collectScreenProperties();
     for (auto& processPool : WebProcessPool::allProcessPools())
-        processPool->sendToAllProcesses(Messages::WebProcess::SetScreenProperties(screenProperties.first, screenProperties.second));
+        processPool->sendToAllProcesses(Messages::WebProcess::SetScreenProperties(screenProperties));
 }
 
 static void registerDisplayConfigurationCallback()

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -618,10 +618,6 @@
     setViewportConfigurationViewLayoutSize(parameters.viewportConfigurationViewLayoutSize);
     setMaximumUnobscuredSize(parameters.maximumUnobscuredSize);
 #endif
-    
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    GraphicsContext3D::setOpenGLDisplayMask(parameters.displayMask);
-#endif
 }
 
 #if ENABLE(WEB_RTC)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -1073,10 +1073,6 @@
     void didFinishLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&);
 #endif
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    void openGLDisplayMaskChanged(uint32_t displayMask);
-#endif
-
     UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
 
     bool isSuspended() const { return m_isSuspended; }

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2018-06-06 04:35:12 UTC (rev 232535)
@@ -514,9 +514,5 @@
     GetApplicationManifest(WebKit::CallbackID callbackID)
 #endif
 
-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-    OpenGLDisplayMaskChanged(uint32_t displayMask)
-#endif
-
     SetDefersLoading(bool defersLoading)
 }

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm	2018-06-06 04:35:12 UTC (rev 232535)
@@ -1147,13 +1147,6 @@
 }
 #endif
 
-#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-void WebPage::openGLDisplayMaskChanged(uint32_t displayMask)
-{
-    GraphicsContext3D::setOpenGLDisplayMask(displayMask);
-}
-#endif
-
 } // namespace WebKit
 
 #endif // PLATFORM(MAC)

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-06-06 04:35:12 UTC (rev 232535)
@@ -1685,9 +1685,9 @@
 #endif
 
 #if PLATFORM(MAC)
-void WebProcess::setScreenProperties(uint32_t primaryScreenID, const HashMap<uint32_t, WebCore::ScreenProperties>& properties)
+void WebProcess::setScreenProperties(const WebCore::ScreenProperties& properties)
 {
-    WebCore::setScreenProperties(primaryScreenID, properties);
+    WebCore::setScreenProperties(properties);
 }
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2018-06-06 04:35:12 UTC (rev 232535)
@@ -371,7 +371,7 @@
     void didReceiveSyncWebProcessMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
 
 #if PLATFORM(MAC)
-    void setScreenProperties(uint32_t primaryScreenID, const HashMap<uint32_t, WebCore::ScreenProperties>&);
+    void setScreenProperties(const WebCore::ScreenProperties&);
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     void scrollerStylePreferenceChanged(bool useOverlayScrollbars);
 #endif

Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2018-06-06 04:35:12 UTC (rev 232535)
@@ -130,7 +130,7 @@
     UpdateActivePages()
 
 #if PLATFORM(MAC)
-    SetScreenProperties(uint32_t primaryScreenID, HashMap<uint32_t, WebCore::ScreenProperties> screenProperties)
+    SetScreenProperties(struct WebCore::ScreenProperties screenProperties)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     ScrollerStylePreferenceChanged(bool useOvelayScrollbars)
 #endif

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (232534 => 232535)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-06-06 04:25:48 UTC (rev 232534)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-06-06 04:35:12 UTC (rev 232535)
@@ -193,7 +193,7 @@
     }
 
 #if PLATFORM(MAC)
-    WebCore::setScreenProperties(parameters.primaryDisplayID, parameters.screenPropertiesMap);
+    WebCore::setScreenProperties(parameters.screenProperties);
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to