+2011-09-26 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Texmap][Qt] Enable TextureMapperGL in platforms where BGRA is not present
+ https://bugs.webkit.org/show_bug.cgi?id=65473
+
+ Reviewed by Andreas Kling.
+
+ For now, swap RGBA->BGRA in software if we're in OpenGL ES 2.
+ We do that by iterating on the pixels and manually swapping each pixel's red and blue
+ values. This can be done faster with shaders, but for now this is a working solution
+ for platforms without BGRA support.
+
+ No new tests. Existing layout tests cover this.
+
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::BitmapTextureGL::endPaint):
+ * platform/graphics/opengl/TextureMapperGL.h:
+ * platform/graphics/qt/TextureMapperQt.cpp:
+ (WebCore::RGBA32PremultimpliedBufferQt::swapRGB):
+
2011-09-26 Sergio Villar Senin <svillar@igalia.com>
[GTK] Fix coding style bits in ResourceHandleSoup.cpp
return;
m_buffer->endPaint();
GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
+#ifdef TEXMAP_OPENGL_ES_2
+ // FIXME: use shaders for RGBA->BGRA swap if this becomes a performance issue.
+ m_buffer->swapRGB();
+ GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirtyRect.x(), m_dirtyRect.y(), m_dirtyRect.width(), m_dirtyRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, m_buffer->data()))
+#else
GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirtyRect.x(), m_dirtyRect.y(), m_dirtyRect.width(), m_dirtyRect.height(), GL_BGRA, GL_UNSIGNED_BYTE, m_buffer->data()))
+#endif
m_buffer.clear();
}
public:
virtual ~RGBA32PremultimpliedBuffer() {}
virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect, bool opaque) = 0;
+ virtual void swapRGB() = 0;
virtual void endPaint() = 0;
virtual const void* data() const = 0;
static PassRefPtr<RGBA32PremultimpliedBuffer> create();