Title: [133202] trunk/Source/WebCore
Revision
133202
Author
k...@google.com
Date
2012-11-01 11:53:40 -0700 (Thu, 01 Nov 2012)

Log Message

Add RGB to supported destination formats of ImageBuffer::copyToPlatformTexture
https://bugs.webkit.org/show_bug.cgi?id=100971

Reviewed by Stephen White.

The ImageBuffer::copyToPlatformTexture restriction added in
r132965 was too restrictive. Allow RGB textures to prevent
performance regressions.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::texImage2D):
* platform/graphics/ImageBuffer.h:
(ImageBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133201 => 133202)


--- trunk/Source/WebCore/ChangeLog	2012-11-01 18:41:06 UTC (rev 133201)
+++ trunk/Source/WebCore/ChangeLog	2012-11-01 18:53:40 UTC (rev 133202)
@@ -1,3 +1,20 @@
+2012-11-01  Kenneth Russell  <k...@google.com>
+
+        Add RGB to supported destination formats of ImageBuffer::copyToPlatformTexture
+        https://bugs.webkit.org/show_bug.cgi?id=100971
+
+        Reviewed by Stephen White.
+
+        The ImageBuffer::copyToPlatformTexture restriction added in
+        r132965 was too restrictive. Allow RGB textures to prevent
+        performance regressions.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore):
+        (WebCore::WebGLRenderingContext::texImage2D):
+        * platform/graphics/ImageBuffer.h:
+        (ImageBuffer):
+
 2012-11-01  Michael Matovsky  <mmatov...@rim.com>
 
         [BlackBerry] Web page view state should be preserved for pages loaded from page cache

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (133201 => 133202)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2012-11-01 18:41:06 UTC (rev 133201)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2012-11-01 18:53:40 UTC (rev 133202)
@@ -3700,10 +3700,10 @@
     // If possible, copy from the canvas element directly to the texture
     // via the GPU, without a read-back to system memory.
     //
-    // FIXME: restriction of RGBA/UNSIGNED_BYTE should be lifted when
+    // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE should be lifted when
     // ImageBuffer::copyToPlatformTexture implementations are fully functional.
     if (GraphicsContext3D::TEXTURE_2D == target && texture && type == texture->getType(target, level)
-        && format == GraphicsContext3D::RGBA && type == GraphicsContext3D::UNSIGNED_BYTE) {
+        && (format == GraphicsContext3D::RGB || format == GraphicsContext3D::RGBA) && type == GraphicsContext3D::UNSIGNED_BYTE) {
         ImageBuffer* buffer = canvas->buffer();
         if (buffer && buffer->copyToPlatformTexture(*m_context.get(), texture->object(), internalformat, m_unpackPremultiplyAlpha, m_unpackFlipY)) {
             texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type);

Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (133201 => 133202)


--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2012-11-01 18:41:06 UTC (rev 133201)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2012-11-01 18:53:40 UTC (rev 133202)
@@ -120,7 +120,7 @@
 #endif
 
         // FIXME: current implementations of this method have the restriction that they only work
-        // with textures that are RGBA format and UNSIGNED_BYTE type.
+        // with textures that are RGB or RGBA format, and UNSIGNED_BYTE type.
         bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, bool, bool);
 
         void reportMemoryUsage(MemoryObjectInfo*) const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to