Title: [228191] trunk/Source/WebCore
- Revision
- 228191
- Author
- d...@apple.com
- Date
- 2018-02-06 14:23:11 -0800 (Tue, 06 Feb 2018)
Log Message
REGRESSION: WebGL no longer producing a transparent canvas on iOS
https://bugs.webkit.org/show_bug.cgi?id=182550
<rdar://problem/37234491>
Reviewed by Eric Carlson.
Due to some weirdness GL_RGBA8 is sometimes different between iOS and
other platforms. Only tell the WebGLLayer that it is opaque when it really
is not transparent.
Covered by existing test: fast/canvas/webgl/context-attributes-alpha
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Look at the context
attributes to decide if we should use an opaque layer.
* platform/graphics/cocoa/WebGLLayer.mm: Ditto.
(-[WebGLLayer initWithGraphicsContext3D:]):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (228190 => 228191)
--- trunk/Source/WebCore/ChangeLog 2018-02-06 22:00:27 UTC (rev 228190)
+++ trunk/Source/WebCore/ChangeLog 2018-02-06 22:23:11 UTC (rev 228191)
@@ -1,3 +1,23 @@
+2018-02-06 Dean Jackson <d...@apple.com>
+
+ REGRESSION: WebGL no longer producing a transparent canvas on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=182550
+ <rdar://problem/37234491>
+
+ Reviewed by Eric Carlson.
+
+ Due to some weirdness GL_RGBA8 is sometimes different between iOS and
+ other platforms. Only tell the WebGLLayer that it is opaque when it really
+ is not transparent.
+
+ Covered by existing test: fast/canvas/webgl/context-attributes-alpha
+
+ * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
+ (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Look at the context
+ attributes to decide if we should use an opaque layer.
+ * platform/graphics/cocoa/WebGLLayer.mm: Ditto.
+ (-[WebGLLayer initWithGraphicsContext3D:]):
+
2018-02-06 Andy Estes <aes...@apple.com>
[WebIDL] Support optional Promise arguments
Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm (228190 => 228191)
--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm 2018-02-06 22:00:27 UTC (rev 228190)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm 2018-02-06 22:23:11 UTC (rev 228191)
@@ -602,7 +602,7 @@
CGRect previousBounds = [m_webGLLayer.get() bounds];
[m_webGLLayer setBounds:CGRectMake(0, 0, width, height)];
- [m_webGLLayer setOpaque:(m_internalColorFormat != GL_RGBA8)];
+ [m_webGLLayer setOpaque:!m_attrs.alpha];
[m_contextObj renderbufferStorage:GL_RENDERBUFFER fromDrawable:static_cast<id<EAGLDrawable>>(m_webGLLayer.get())];
Modified: trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm (228190 => 228191)
--- trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm 2018-02-06 22:00:27 UTC (rev 228190)
+++ trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm 2018-02-06 22:23:11 UTC (rev 228191)
@@ -57,6 +57,8 @@
self.contentsOpaque = !context->getContextAttributes().alpha;
self.transform = CATransform3DIdentity;
self.contentsScale = _devicePixelRatio;
+#else
+ self.opaque = !context->getContextAttributes().alpha;
#endif
return self;
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes