Title: [135731] trunk/Source/WebCore
Revision
135731
Author
[email protected]
Date
2012-11-26 08:40:24 -0800 (Mon, 26 Nov 2012)

Log Message

[EFL] Crashes in compositing layout tests with AC on.
https://bugs.webkit.org/show_bug.cgi?id=103144

Patch by Viatcheslav Ostapenko <[email protected]> on 2012-11-26
Reviewed by Noam Rosenthal.

Application could leave texture packing parameters in non-zero state before
texture mapper drawing/texture uploading. To avoid crash texture upload should
specify packing parameters before each texture upload if packing is supported.

Covered by existing tests.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::BitmapTextureGL::updateContentsNoSwizzle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135730 => 135731)


--- trunk/Source/WebCore/ChangeLog	2012-11-26 16:37:38 UTC (rev 135730)
+++ trunk/Source/WebCore/ChangeLog	2012-11-26 16:40:24 UTC (rev 135731)
@@ -1,3 +1,19 @@
+2012-11-26  Viatcheslav Ostapenko  <[email protected]>
+
+        [EFL] Crashes in compositing layout tests with AC on.
+        https://bugs.webkit.org/show_bug.cgi?id=103144
+
+        Reviewed by Noam Rosenthal.
+
+        Application could leave texture packing parameters in non-zero state before
+        texture mapper drawing/texture uploading. To avoid crash texture upload should
+        specify packing parameters before each texture upload if packing is supported.
+
+        Covered by existing tests.
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
+
 2012-11-26  George Staikos  <[email protected]>
 
         [BlackBerry] Remove a lot of unnecessary and incorrect code causing crashes

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (135730 => 135731)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-11-26 16:37:38 UTC (rev 135730)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-11-26 16:40:24 UTC (rev 135731)
@@ -691,21 +691,21 @@
 
 void BitmapTextureGL::updateContentsNoSwizzle(const void* srcData, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, unsigned bytesPerPixel, Platform3DObject glFormat)
 {
-    if (!driverSupportsSubImage() // For ES drivers that don't support sub-images.
-        || (bytesPerLine == static_cast<int>(targetRect.width() * bytesPerPixel) && sourceOffset == IntPoint::zero())) {
-        m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, srcData);
-        return;
+#if !defined(TEXMAP_OPENGL_ES_2)
+    if (driverSupportsSubImage()) { // For ES drivers that don't support sub-images.
+        // Use the OpenGL sub-image extension, now that we know it's available.
+        m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
+        m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y());
+        m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x());
     }
-
+#endif
+    m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, srcData);
 #if !defined(TEXMAP_OPENGL_ES_2)
-    // Use the OpenGL sub-image extension, now that we know it's available.
-    m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
-    m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y());
-    m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x());
-    m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, srcData);
-    m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-    m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, 0);
-    m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+    if (driverSupportsSubImage()) { // For ES drivers that don't support sub-images.
+        m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+        m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+        m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+    }
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to