Title: [123759] trunk/Source/WebCore
Revision
123759
Author
commit-qu...@webkit.org
Date
2012-07-26 09:34:29 -0700 (Thu, 26 Jul 2012)

Log Message

[BlackBerry] readPixels on FBOs are limited to canvas size on SGX platforms
https://bugs.webkit.org/show_bug.cgi?id=92301

Patch by Joshua Netterfield <jnetterfi...@rim.com> on 2012-07-26
Reviewed by Rob Buis.

This fixes fast/canvas/webgl/uninitialized-test.html on BlackBerry, no new tests.

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::readPixels):
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123758 => 123759)


--- trunk/Source/WebCore/ChangeLog	2012-07-26 16:26:46 UTC (rev 123758)
+++ trunk/Source/WebCore/ChangeLog	2012-07-26 16:34:29 UTC (rev 123759)
@@ -1,3 +1,16 @@
+2012-07-26  Joshua Netterfield  <jnetterfi...@rim.com>
+
+        [BlackBerry] readPixels on FBOs are limited to canvas size on SGX platforms
+        https://bugs.webkit.org/show_bug.cgi?id=92301
+
+        Reviewed by Rob Buis.
+
+        This fixes fast/canvas/webgl/uninitialized-test.html on BlackBerry, no new tests.
+
+        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
+        (WebCore::GraphicsContext3D::readPixels):
+        (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
+
 2012-07-26  Alexei Filippov  <alex...@chromium.org>
 
         Web Inspector: reduce auto refresh rate of the live native memory diagram

Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp (123758 => 123759)


--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp	2012-07-26 16:26:46 UTC (rev 123758)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp	2012-07-26 16:34:29 UTC (rev 123759)
@@ -55,13 +55,13 @@
     // all previous rendering calls should be done before reading pixels.
     ::glFlush();
 #if PLATFORM(BLACKBERRY)
-    // Imagination specific fix
-    if (m_isImaginationHardware)
+    if (m_isImaginationHardware && m_fbo == m_boundFBO) {
+        // FIXME: This workaround should always be used until the
+        // driver alignment bug is fixed, even when we aren't
+        // drawing to the canvas.
         readPixelsIMG(x, y, width, height, format, type, data);
-    else
+    } else
         ::glReadPixels(x, y, width, height, format, type, data);
-
-    // Note: BlackBerries have a different anti-aliasing pipeline.
 #else
     if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
          resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
@@ -78,7 +78,17 @@
 
 void GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary(int x, int y, int width, int height, unsigned char* pixels)
 {
+#if PLATFORM(BLACKBERRY)
+    if (m_isImaginationHardware && m_fbo == m_boundFBO) {
+        // FIXME: This workaround should always be used until the
+        // driver alignment bug is fixed, even when we aren't
+        // drawing to the canvas.
+        readPixelsIMG(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+    } else
+        ::glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+#else
     ::glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+#endif
     int totalBytes = width * height * 4;
     if (isGLES2Compliant()) {
         for (int i = 0; i < totalBytes; i += 4)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to