Title: [227588] trunk/Source/WebCore
- Revision
- 227588
- Author
- d...@apple.com
- Date
- 2018-01-24 17:17:06 -0800 (Wed, 24 Jan 2018)
Log Message
Move WebGL's colorspace code into IOSurface
https://bugs.webkit.org/show_bug.cgi?id=182076
<rdar://problem/36846863>
Reviewed by Simon Fraser, with assistance from Tim Horton.
Rather than have WebGLLayer talk directly to an IOSurfaceRef,
use a helper function on WebCore::IOSurface.
No behaviour change.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::migrateColorSpaceToProperties): Add new helper.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): The
newly created IOSurfaces call the helper to set up their colorspace.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (227587 => 227588)
--- trunk/Source/WebCore/ChangeLog 2018-01-25 01:07:50 UTC (rev 227587)
+++ trunk/Source/WebCore/ChangeLog 2018-01-25 01:17:06 UTC (rev 227588)
@@ -1,5 +1,25 @@
2018-01-24 Dean Jackson <d...@apple.com>
+ Move WebGL's colorspace code into IOSurface
+ https://bugs.webkit.org/show_bug.cgi?id=182076
+ <rdar://problem/36846863>
+
+ Reviewed by Simon Fraser, with assistance from Tim Horton.
+
+ Rather than have WebGLLayer talk directly to an IOSurfaceRef,
+ use a helper function on WebCore::IOSurface.
+
+ No behaviour change.
+
+ * platform/graphics/cocoa/IOSurface.h:
+ * platform/graphics/cocoa/IOSurface.mm:
+ (WebCore::IOSurface::migrateColorSpaceToProperties): Add new helper.
+ * platform/graphics/cocoa/WebGLLayer.mm:
+ (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): The
+ newly created IOSurfaces call the helper to set up their colorspace.
+
+2018-01-24 Dean Jackson <d...@apple.com>
+
Add a note about not implementing these functions without discussion.
<rdar://problem/36666458>
Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (227587 => 227588)
--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2018-01-25 01:07:50 UTC (rev 227587)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2018-01-25 01:17:06 UTC (rev 227588)
@@ -139,6 +139,8 @@
WEBCORE_EXPORT static void convertToFormat(std::unique_ptr<WebCore::IOSurface>&& inSurface, Format, WTF::Function<void(std::unique_ptr<WebCore::IOSurface>)>&&);
#endif
+ void migrateColorSpaceToProperties();
+
private:
IOSurface(IntSize, IntSize contextSize, CGColorSpaceRef, Format, bool& success);
IOSurface(IOSurfaceRef, CGColorSpaceRef);
Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (227587 => 227588)
--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2018-01-25 01:07:50 UTC (rev 227587)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2018-01-25 01:17:06 UTC (rev 227588)
@@ -437,6 +437,12 @@
}
#endif // PLATFORM(IOS)
+void IOSurface::migrateColorSpaceToProperties()
+{
+ auto colorSpaceProperties = adoptCF(CGColorSpaceCopyPropertyList(m_colorSpace.get()));
+ IOSurfaceSetValue(m_surface.get(), kIOSurfaceColorSpace, colorSpaceProperties.get());
+}
+
static TextStream& operator<<(TextStream& ts, IOSurface::Format format)
{
switch (format) {
Modified: trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm (227587 => 227588)
--- trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm 2018-01-25 01:07:50 UTC (rev 227587)
+++ trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm 2018-01-25 01:17:06 UTC (rev 227588)
@@ -159,10 +159,9 @@
ASSERT(_drawingBuffer);
ASSERT(_spareBuffer);
- auto sRGBDetails = adoptCF(CGColorSpaceCopyPropertyList(sRGBColorSpaceRef()));
- IOSurfaceSetValue(_contentsBuffer->surface(), kIOSurfaceColorSpace, sRGBDetails.get());
- IOSurfaceSetValue(_drawingBuffer->surface(), kIOSurfaceColorSpace, sRGBDetails.get());
- IOSurfaceSetValue(_spareBuffer->surface(), kIOSurfaceColorSpace, sRGBDetails.get());
+ _contentsBuffer->migrateColorSpaceToProperties();
+ _drawingBuffer->migrateColorSpaceToProperties();
+ _spareBuffer->migrateColorSpaceToProperties();
}
- (void)bindFramebufferToNextAvailableSurface
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes