WebKit Bugzilla
Attachment 341858 Details for
Bug 186198
: Move OpenGL display mask to screen data struct.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch186198.txt (text/plain), 34.41 KB, created by
Per Arne Vollan
on 2018-06-02 18:08:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2018-06-02 18:08:43 PDT
Size:
34.41 KB
patch
obsolete
>Index: Source/WebCore/html/HTMLCanvasElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLCanvasElement.cpp (revision 232448) >+++ Source/WebCore/html/HTMLCanvasElement.cpp (working copy) >@@ -913,7 +913,8 @@ > > RenderingMode renderingMode = shouldAccelerate(size()) ? Accelerated : Unaccelerated; > >- setImageBuffer(ImageBuffer::create(size(), renderingMode)); >+ auto hostWindow = document().view()->root()->hostWindow(); >+ setImageBuffer(ImageBuffer::create(size(), renderingMode, 1, ColorSpaceSRGB, hostWindow)); > if (!m_imageBuffer) > return; > m_imageBuffer->context().setShadowsIgnoreTransforms(true); >Index: Source/WebCore/page/Chrome.cpp >=================================================================== >--- Source/WebCore/page/Chrome.cpp (revision 232448) >+++ Source/WebCore/page/Chrome.cpp (working copy) >@@ -575,4 +575,16 @@ > observer->willOpenPopup(); > } > >+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >+void Chrome::setOpenGLDisplayMask(uint32_t displayMask) >+{ >+ m_displayMask = displayMask; >+} >+ >+uint32_t Chrome::getOpenGLDisplayMask() const >+{ >+ return m_displayMask; >+} >+#endif >+ > } // namespace WebCore >Index: Source/WebCore/page/Chrome.h >=================================================================== >--- Source/WebCore/page/Chrome.h (revision 232448) >+++ Source/WebCore/page/Chrome.h (working copy) >@@ -179,6 +179,11 @@ > void registerPopupOpeningObserver(PopupOpeningObserver&); > void unregisterPopupOpeningObserver(PopupOpeningObserver&); > >+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >+ WEBCORE_EXPORT void setOpenGLDisplayMask(uint32_t displayMask); >+ uint32_t getOpenGLDisplayMask() const override; >+#endif >+ > private: > void notifyPopupOpeningObservers() const; > >@@ -189,6 +194,9 @@ > #if PLATFORM(IOS) > bool m_isDispatchViewportDataDidChangeSuppressed { false }; > #endif >+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >+ uint32_t m_displayMask { 0 }; >+#endif > }; > > } // namespace WebCore >Index: Source/WebCore/platform/HostWindow.h >=================================================================== >--- Source/WebCore/platform/HostWindow.h (revision 232448) >+++ Source/WebCore/platform/HostWindow.h (working copy) >@@ -74,6 +74,10 @@ > virtual FloatSize screenSize() const = 0; > virtual FloatSize availableScreenSize() const = 0; > virtual FloatSize overrideScreenSize() const = 0; >+ >+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >+ virtual uint32_t getOpenGLDisplayMask() const = 0; >+#endif > }; > > } // namespace WebCore >Index: Source/WebCore/platform/PlatformScreen.h >=================================================================== >--- Source/WebCore/platform/PlatformScreen.h (revision 232448) >+++ Source/WebCore/platform/PlatformScreen.h (working copy) >@@ -80,6 +80,7 @@ > > #if PLATFORM(MAC) > struct ScreenProperties; >+struct ScreenData; > > WEBCORE_EXPORT PlatformDisplayID displayID(NSScreen *); > >@@ -95,12 +96,11 @@ > > NSPoint flipScreenPoint(const NSPoint&, NSScreen *); > >-typedef HashMap<PlatformDisplayID, ScreenProperties> ScreenPropertiesMap; >+WEBCORE_EXPORT ScreenProperties collectScreenProperties(); >+WEBCORE_EXPORT void setScreenProperties(const ScreenProperties&); >+ScreenData screenData(PlatformDisplayID); > >-WEBCORE_EXPORT std::pair<PlatformDisplayID, ScreenPropertiesMap> getScreenProperties(); >-WEBCORE_EXPORT void setScreenProperties(PlatformDisplayID primaryScreenID, const ScreenPropertiesMap&); >-ScreenProperties screenProperties(PlatformDisplayID); >- >+uint32_t primaryOpenGLDisplayMask(); > #endif > > #if PLATFORM(IOS) >Index: Source/WebCore/platform/ScreenProperties.h >=================================================================== >--- Source/WebCore/platform/ScreenProperties.h (revision 232448) >+++ Source/WebCore/platform/ScreenProperties.h (working copy) >@@ -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; >@@ -52,6 +53,17 @@ > }; > > 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 }; >+ uint32_t primaryOpenGLDisplayMask { 0 }; >+ ScreenDataMap screenDataMap; >+ >+ template<class Encoder> void encode(Encoder&) const; > template<class Decoder> static std::optional<ScreenProperties> decode(Decoder&); > }; > >@@ -58,6 +70,35 @@ > template<class Encoder> > void ScreenProperties::encode(Encoder& encoder) const > { >+ encoder << primaryDisplayID; >+ encoder << primaryOpenGLDisplayMask; >+ 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<uint32_t> primaryOpenGLDisplayMask; >+ decoder >> primaryOpenGLDisplayMask; >+ if (!primaryOpenGLDisplayMask) >+ return std::nullopt; >+ >+ std::optional<ScreenDataMap> screenDataMap; >+ decoder >> screenDataMap; >+ if (!screenDataMap) >+ return std::nullopt; >+ >+ return { { *primaryDisplayID, *primaryOpenGLDisplayMask, WTFMove(*screenDataMap) } }; >+} >+ >+template<class Encoder> >+void ScreenData::encode(Encoder& encoder) const >+{ > encoder << screenAvailableRect << screenRect << screenDepth << screenDepthPerComponent << screenSupportsExtendedColor << screenHasInvertedColors << screenIsMonochrome; > > if (colorSpace) { >@@ -85,7 +126,7 @@ > } > > template<class Decoder> >-std::optional<ScreenProperties> ScreenProperties::decode(Decoder& decoder) >+std::optional<ScreenData> ScreenData::decode(Decoder& decoder) > { > std::optional<FloatRect> screenAvailableRect; > decoder >> screenAvailableRect; >Index: Source/WebCore/platform/graphics/GraphicsContext3D.h >=================================================================== >--- Source/WebCore/platform/graphics/GraphicsContext3D.h (revision 232448) >+++ Source/WebCore/platform/graphics/GraphicsContext3D.h (working copy) >@@ -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); > >@@ -1321,7 +1316,7 @@ > void attachDepthAndStencilBufferIfNeeded(GLuint internalDepthStencilFormat, int width, int height); > > #if PLATFORM(COCOA) >- bool allowOfflineRenderers() const; >+ bool allowOfflineRenderers(const HostWindow* hostWindow) const; > #endif > > int m_currentWidth { 0 }; >@@ -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 >Index: Source/WebCore/platform/graphics/ImageBuffer.cpp >=================================================================== >--- Source/WebCore/platform/graphics/ImageBuffer.cpp (revision 232448) >+++ Source/WebCore/platform/graphics/ImageBuffer.cpp (working copy) >@@ -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; >Index: Source/WebCore/platform/graphics/ImageBuffer.h >=================================================================== >--- Source/WebCore/platform/graphics/ImageBuffer.h (revision 232448) >+++ Source/WebCore/platform/graphics/ImageBuffer.h (working copy) >@@ -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* 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* 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); >Index: Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp >=================================================================== >--- Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (revision 232448) >+++ Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (working copy) >@@ -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,7 +152,7 @@ > 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 >@@ -193,8 +193,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) > { > } > >Index: Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm >=================================================================== >--- Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm (revision 232448) >+++ Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm (working copy) >@@ -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) >@@ -465,19 +466,19 @@ > m_powerPreferenceUsedForCreation = GraphicsContext3DPowerPreference::Default; > #endif > >- setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers()); >+ setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers(hostWindow)); > CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats); > > if (!numPixelFormats) { >- setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers()); >+ setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers(hostWindow)); > CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats); > > if (!numPixelFormats) { >- setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers()); >+ setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.useGLES3, allowOfflineRenderers(hostWindow)); > CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats); > > if (!attrs.forceSoftwareRenderer && !numPixelFormats) { >- setPixelFormat(attribs, 32, 16, false, false, true, false, attrs.useGLES3, allowOfflineRenderers()); >+ setPixelFormat(attribs, 32, 16, false, false, true, false, attrs.useGLES3, allowOfflineRenderers(hostWindow)); > CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats); > useMultisampling = false; > } >@@ -492,8 +493,11 @@ > 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); >+ auto displayMask = primaryOpenGLDisplayMask(); >+ if (hostWindow && hostWindow->getOpenGLDisplayMask()) >+ displayMask = hostWindow->getOpenGLDisplayMask(); >+ if (displayMask) >+ identifyAndSetCurrentGPU(pixelFormatObj, numPixelFormats, displayMask, m_contextObj); > #endif > > CGLDestroyPixelFormat(pixelFormatObj); >@@ -789,22 +793,8 @@ > manager().updateAllContexts(); > } > >-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >-void GraphicsContext3D::setOpenGLDisplayMask(CGOpenGLDisplayMask displayMask) >+bool GraphicsContext3D::allowOfflineRenderers(const HostWindow* hostWindow) const > { >- 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) > // When WindowServer access is blocked in the WebProcess, there is no way > // for OpenGL to decide which GPU is connected to a display (online/offline). >@@ -812,7 +802,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 (hostWindow && hostWindow->getOpenGLDisplayMask()) > return true; > #endif > >Index: Source/WebCore/platform/graphics/cocoa/IOSurface.h >=================================================================== >--- Source/WebCore/platform/graphics/cocoa/IOSurface.h (revision 232448) >+++ Source/WebCore/platform/graphics/cocoa/IOSurface.h (working copy) >@@ -38,6 +38,8 @@ > > namespace WebCore { > >+class HostWindow; >+ > class IOSurface final { > WTF_MAKE_FAST_ALLOCATED; > public: >@@ -105,7 +107,7 @@ > id asLayerContents() const { return reinterpret_cast<id>(m_surface.get()); } > IOSurfaceRef surface() const { return m_surface.get(); } > WEBCORE_EXPORT GraphicsContext& ensureGraphicsContext(); >- WEBCORE_EXPORT CGContextRef ensurePlatformContext(); >+ WEBCORE_EXPORT CGContextRef ensurePlatformContext(const HostWindow* hostWindow = nullptr); > > enum class SurfaceState { > Valid, >Index: Source/WebCore/platform/graphics/cocoa/IOSurface.mm >=================================================================== >--- Source/WebCore/platform/graphics/cocoa/IOSurface.mm (revision 232448) >+++ Source/WebCore/platform/graphics/cocoa/IOSurface.mm (working copy) >@@ -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,10 @@ > 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 (hostWindow && hostWindow->getOpenGLDisplayMask()) >+ CGIOSurfaceContextSetDisplayMask(m_cgContext.get(), hostWindow->getOpenGLDisplayMask()); >+ else >+ CGIOSurfaceContextSetDisplayMask(m_cgContext.get(), primaryOpenGLDisplayMask()); > #endif > > return m_cgContext.get(); >Index: Source/WebCore/platform/mac/PlatformScreenMac.mm >=================================================================== >--- Source/WebCore/platform/mac/PlatformScreenMac.mm (revision 232448) >+++ Source/WebCore/platform/mac/PlatformScreenMac.mm (working copy) >@@ -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); >@@ -129,45 +128,52 @@ > bool screenHasInvertedColors = CGDisplayUsesInvertedPolarity(); > bool screenIsMonochrome = CGDisplayUsesForceToGray(); > >- 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 }); > >- if (!firstScreen) >- firstScreen = displayID; >+ if (!screenProperties.primaryDisplayID) >+ screenProperties.primaryDisplayID = displayID; >+ >+ if (!screenProperties.primaryOpenGLDisplayMask) >+ screenProperties.primaryOpenGLDisplayMask = CGDisplayIDToOpenGLDisplayMask(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) >+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)); >+ return screenProperties().primaryOpenGLDisplayMask; > } >+ >+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 +183,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 +193,7 @@ > > int screenDepth(Widget* widget) > { >- if (!screenProperties().isEmpty()) { >+ if (!screenProperties().screenDataMap.isEmpty()) { > auto screenDepth = getScreenProperties(widget).screenDepth; > ASSERT(screenDepth); > return screenDepth; >@@ -199,7 +205,7 @@ > > int screenDepthPerComponent(Widget* widget) > { >- if (!screenProperties().isEmpty()) { >+ if (!screenProperties().screenDataMap.isEmpty()) { > auto depthPerComponent = getScreenProperties(widget).screenDepthPerComponent; > ASSERT(depthPerComponent); > return depthPerComponent; >@@ -211,8 +217,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 +234,7 @@ > > FloatRect screenRect(Widget* widget) > { >- if (!screenProperties().isEmpty()) >+ if (!screenProperties().screenDataMap.isEmpty()) > return getScreenProperties(widget).screenRect; > > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); >@@ -237,7 +243,7 @@ > > FloatRect screenAvailableRect(Widget* widget) > { >- if (!screenProperties().isEmpty()) >+ if (!screenProperties().screenDataMap.isEmpty()) > return getScreenProperties(widget).screenAvailableRect; > > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); >@@ -262,7 +268,7 @@ > > CGColorSpaceRef screenColorSpace(Widget* widget) > { >- if (!screenProperties().isEmpty()) >+ if (!screenProperties().screenDataMap.isEmpty()) > return getScreenProperties(widget).colorSpace.get(); > > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); >@@ -271,7 +277,7 @@ > > bool screenSupportsExtendedColor(Widget* widget) > { >- if (!screenProperties().isEmpty()) >+ if (!screenProperties().screenDataMap.isEmpty()) > return getScreenProperties(widget).screenSupportsExtendedColor; > > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); >Index: Source/WebKit/Shared/WebProcessCreationParameters.cpp >=================================================================== >--- Source/WebKit/Shared/WebProcessCreationParameters.cpp (revision 232448) >+++ Source/WebKit/Shared/WebProcessCreationParameters.cpp (working copy) >@@ -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; >Index: Source/WebKit/Shared/WebProcessCreationParameters.h >=================================================================== >--- Source/WebKit/Shared/WebProcessCreationParameters.h (revision 232448) >+++ Source/WebKit/Shared/WebProcessCreationParameters.h (working copy) >@@ -195,8 +195,7 @@ > #endif > > #if PLATFORM(MAC) >- WebCore::PlatformDisplayID primaryDisplayID { 0 }; >- WebCore::ScreenPropertiesMap screenPropertiesMap; >+ WebCore::ScreenProperties screenProperties; > #endif > }; > >Index: Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (revision 232448) >+++ Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (working copy) >@@ -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 > } > >Index: Source/WebKit/UIProcess/WebProcessPool.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebProcessPool.cpp (revision 232448) >+++ Source/WebKit/UIProcess/WebProcessPool.cpp (working copy) >@@ -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 > } > >@@ -812,9 +812,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() >Index: Source/WebKit/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.cpp (revision 232448) >+++ Source/WebKit/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -620,7 +620,7 @@ > #endif > > #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >- GraphicsContext3D::setOpenGLDisplayMask(parameters.displayMask); >+ m_page->chrome().setOpenGLDisplayMask(parameters.displayMask); > #endif > } > >Index: Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (revision 232448) >+++ Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (working copy) >@@ -57,6 +57,7 @@ > #import <QuartzCore/QuartzCore.h> > #import <WebCore/AXObjectCache.h> > #import <WebCore/BackForwardController.h> >+#import <WebCore/Chrome.h> > #import <WebCore/DataDetection.h> > #import <WebCore/DictionaryLookup.h> > #import <WebCore/Editing.h> >@@ -1150,7 +1151,7 @@ > #if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) > void WebPage::openGLDisplayMaskChanged(uint32_t displayMask) > { >- GraphicsContext3D::setOpenGLDisplayMask(displayMask); >+ m_page->chrome().setOpenGLDisplayMask(displayMask); > } > #endif > >Index: Source/WebKit/WebProcess/WebProcess.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.cpp (revision 232448) >+++ Source/WebKit/WebProcess/WebProcess.cpp (working copy) >@@ -1678,9 +1678,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 > >Index: Source/WebKit/WebProcess/WebProcess.h >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.h (revision 232448) >+++ Source/WebKit/WebProcess/WebProcess.h (working copy) >@@ -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 >Index: Source/WebKit/WebProcess/WebProcess.messages.in >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.messages.in (revision 232448) >+++ Source/WebKit/WebProcess/WebProcess.messages.in (working copy) >@@ -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 >Index: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >=================================================================== >--- Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (revision 232448) >+++ Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (working copy) >@@ -193,7 +193,7 @@ > } > > #if PLATFORM(MAC) >- WebCore::setScreenProperties(parameters.primaryDisplayID, parameters.screenPropertiesMap); >+ WebCore::setScreenProperties(parameters.screenProperties); > #endif > } > >Index: WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme >=================================================================== >--- WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme (revision 232448) >+++ WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme (working copy) >@@ -1,6 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <Scheme >- version = "1.7"> >+ version = "1.3"> > <BuildAction > parallelizeBuildables = "NO" > buildImplicitDependencies = "YES"> >@@ -137,7 +137,6 @@ > buildConfiguration = "Debug" > selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" > selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" >- language = "" > shouldUseLaunchSchemeArgsEnv = "YES"> > <Testables> > </Testables> >@@ -157,7 +156,6 @@ > buildConfiguration = "Debug" > selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" > selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" >- language = "" > launchStyle = "0" > useCustomWorkingDirectory = "NO" > ignoresPersistentStateOnLaunch = "YES"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186198
:
341858
|
341862
|
341913
|
341930
|
341933
|
341935
|
341937
|
341950
|
341971
|
341972
|
341990
|
341995
|
342022