Skip to content
Permalink
Browse files
Avoid duplicate multisample resolve before WebGL compositing
https://bugs.webkit.org/show_bug.cgi?id=178537
<rdar://problem/35080724>

Reviewed by Jer Noble.

Both endPaint and prepareTexture were doing the MSAA resolve
into the renderbuffer, and being called on macOS before compositing.
Without that step, endPaint became unnecessary on iOS so I renamed
it presentRenderbuffer.

Covered by existing tests.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::presentRenderbuffer):
(WebCore::GraphicsContext3D::endPaint): Deleted.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]):

Canonical link: https://commits.webkit.org/194723@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grorg committed Oct 19, 2017
1 parent f0ab08a commit 7b39b66e11e3d93727dee7347d3acdb4a48afc4d
@@ -1,3 +1,25 @@
2017-10-19 Dean Jackson <dino@apple.com>

Avoid duplicate multisample resolve before WebGL compositing
https://bugs.webkit.org/show_bug.cgi?id=178537
<rdar://problem/35080724>

Reviewed by Jer Noble.

Both endPaint and prepareTexture were doing the MSAA resolve
into the renderbuffer, and being called on macOS before compositing.
Without that step, endPaint became unnecessary on iOS so I renamed
it presentRenderbuffer.

Covered by existing tests.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::presentRenderbuffer):
(WebCore::GraphicsContext3D::endPaint): Deleted.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]):

2017-10-19 Andy Estes <aestes@apple.com>

[Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
@@ -1150,10 +1150,13 @@ class GraphicsContext3D : public RefCounted<GraphicsContext3D> {
bool paintCompositedResultsToCanvas(ImageBuffer*);

#if PLATFORM(COCOA)
void endPaint();
bool texImageIOSurface2D(GC3Denum target, GC3Denum internalFormat, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, IOSurfaceRef, GC3Duint plane);
#endif

#if PLATFORM(IOS)
void presentRenderbuffer();
#endif

#if PLATFORM(MAC)
void allocateIOSurfaceBackingStore(IntSize);
void updateFramebufferTextureBackingStoreFromLayer();
@@ -657,21 +657,19 @@ static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBi
#endif
}

void GraphicsContext3D::endPaint()
#if PLATFORM(IOS)
void GraphicsContext3D::presentRenderbuffer()
{
makeContextCurrent();
if (m_attrs.antialias)
resolveMultisamplingIfNecessary();
#if PLATFORM(IOS)
// This is the place where we actually push our current rendering
// results to the compositor on iOS. On macOS it comes from the
// calling function, which is inside WebGLLayer.

::glFlush();
::glBindRenderbuffer(GL_RENDERBUFFER, m_texture);
[static_cast<EAGLContext*>(m_contextObj) presentRenderbuffer:GL_RENDERBUFFER];
[EAGLContext setCurrentContext:nil];
#endif
}
#endif

bool GraphicsContext3D::texImageIOSurface2D(GC3Denum target, GC3Denum internalFormat, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, IOSurfaceRef surface, GC3Duint plane)
{
@@ -128,8 +128,6 @@ - (void)display
if (!_context)
return;

_context->endPaint();

#if PLATFORM(MAC)
_context->prepareTexture();
if (_drawingBuffer) {
@@ -138,6 +136,8 @@ - (void)display
[self reloadValueForKeyPath:@"contents"];
[self bindFramebufferToNextAvailableSurface];
}
#else
_context->presentRenderbuffer();
#endif

_context->markLayerComposited();

0 comments on commit 7b39b66

Please sign in to comment.