Title: [261322] trunk/Source/ThirdParty/ANGLE
Revision
261322
Author
[email protected]
Date
2020-05-07 11:42:21 -0700 (Thu, 07 May 2020)

Log Message

Fix Google Maps rendering corruption in simulator with ANGLE
https://bugs.webkit.org/show_bug.cgi?id=211398

glReadPixels call needs to respect the row stride of the IOSurface.

Patch by James Darpinian <[email protected]> on 2020-05-07
Reviewed by Alex Christensen.

* src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.h:
* src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm:
(rx::IOSurfaceSurfaceEAGL::IOSurfaceSurfaceEAGL):
(rx::IOSurfaceSurfaceEAGL::releaseTexImage):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (261321 => 261322)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2020-05-07 18:38:52 UTC (rev 261321)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2020-05-07 18:42:21 UTC (rev 261322)
@@ -1,3 +1,17 @@
+2020-05-07  James Darpinian  <[email protected]>
+
+        Fix Google Maps rendering corruption in simulator with ANGLE
+        https://bugs.webkit.org/show_bug.cgi?id=211398
+
+        glReadPixels call needs to respect the row stride of the IOSurface.
+
+        Reviewed by Alex Christensen.
+
+        * src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.h:
+        * src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm:
+        (rx::IOSurfaceSurfaceEAGL::IOSurfaceSurfaceEAGL):
+        (rx::IOSurfaceSurfaceEAGL::releaseTexImage):
+
 2020-05-07  Dean Jackson  <[email protected]>
 
         Update ANGLE to 2020-03-27

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.h (261321 => 261322)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.h	2020-05-07 18:38:52 UTC (rev 261321)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.h	2020-05-07 18:42:21 UTC (rev 261322)
@@ -75,6 +75,7 @@
     int mHeight;
     int mPlane;
     int mFormatIndex;
+    int mRowStrideInPixels;
 
     bool mAlphaInitialized;
 #if defined(ANGLE_PLATFORM_IOS_SIMULATOR)

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm (261321 => 261322)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm	2020-05-07 18:38:52 UTC (rev 261321)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm	2020-05-07 18:42:21 UTC (rev 261322)
@@ -83,6 +83,7 @@
       mWidth(0),
       mHeight(0),
       mPlane(0),
+      mRowStrideInPixels(0),
       mFormatIndex(-1),
       mAlphaInitialized(false)
 {
@@ -94,6 +95,11 @@
     mWidth  = static_cast<int>(attribs.get(EGL_WIDTH));
     mHeight = static_cast<int>(attribs.get(EGL_HEIGHT));
     mPlane  = static_cast<int>(attribs.get(EGL_IOSURFACE_PLANE_ANGLE));
+    // Hopefully the number of bytes per row is always an integer number of pixels.
+    // We use glReadPixels to fill the IOSurface in the simulator and it can only
+    // support strides that are an integer number of pixels.
+    ASSERT(IOSurfaceGetBytesPerRowOfPlane(mIOSurface, mPlane) % IOSurfaceGetBytesPerElementOfPlane(mIOSurface, mPlane) == 0);
+    mRowStrideInPixels = static_cast<int>(IOSurfaceGetBytesPerRowOfPlane(mIOSurface, mPlane) / IOSurfaceGetBytesPerElementOfPlane(mIOSurface, mPlane));
 
     EGLAttrib internalFormat = attribs.get(EGL_TEXTURE_INTERNAL_FORMAT_ANGLE);
     EGLAttrib type           = attribs.get(EGL_TEXTURE_TYPE_ANGLE);
@@ -227,6 +233,7 @@
         functions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
                                         mBoundTextureID, 0);
         gl::PixelPackState state;
+        state.rowLength = mRowStrideInPixels;
         state.alignment = 1;
         stateManager->setPixelPackState(state);
         // TODO(kbr): possibly more state to be set here, including setting any
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to