Changeset 95939 in webkit
- Timestamp:
- Sep 26, 2011 3:51:59 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r95938 r95939 1 2011-09-26 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 [Texmap][Qt] Enable TextureMapperGL in platforms where BGRA is not present 4 https://bugs.webkit.org/show_bug.cgi?id=65473 5 6 Reviewed by Andreas Kling. 7 8 For now, swap RGBA->BGRA in software if we're in OpenGL ES 2. 9 We do that by iterating on the pixels and manually swapping each pixel's red and blue 10 values. This can be done faster with shaders, but for now this is a working solution 11 for platforms without BGRA support. 12 13 No new tests. Existing layout tests cover this. 14 15 * platform/graphics/opengl/TextureMapperGL.cpp: 16 (WebCore::BitmapTextureGL::endPaint): 17 * platform/graphics/opengl/TextureMapperGL.h: 18 * platform/graphics/qt/TextureMapperQt.cpp: 19 (WebCore::RGBA32PremultimpliedBufferQt::swapRGB): 20 1 21 2011-09-26 Sergio Villar Senin <svillar@igalia.com> 2 22 -
trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
r95901 r95939 535 535 m_buffer->endPaint(); 536 536 GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id)) 537 #ifdef TEXMAP_OPENGL_ES_2 538 // FIXME: use shaders for RGBA->BGRA swap if this becomes a performance issue. 539 m_buffer->swapRGB(); 540 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())) 541 #else 537 542 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())) 543 #endif 538 544 m_buffer.clear(); 539 545 } -
trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.h
r95901 r95939 68 68 virtual ~RGBA32PremultimpliedBuffer() {} 69 69 virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect, bool opaque) = 0; 70 virtual void swapRGB() = 0; 70 71 virtual void endPaint() = 0; 71 72 virtual const void* data() const = 0; -
trunk/Source/WebCore/platform/graphics/qt/TextureMapperQt.cpp
r95901 r95939 229 229 } 230 230 231 void swapRGB() 232 { 233 m_image = m_image.rgbSwapped(); 234 } 235 231 236 virtual void endPaint() { m_painter.end(); } 232 237 virtual const void* data() const { return m_image.constBits(); }
Note: See TracChangeset
for help on using the changeset viewer.