Title: [166480] trunk/Source/WebCore
Revision
166480
Author
calva...@igalia.com
Date
2014-03-30 23:39:51 -0700 (Sun, 30 Mar 2014)

Log Message

[GTK] [TextureMapper] Weird brightness with some videos with acceletared compositing
https://bugs.webkit.org/show_bug.cgi?id=130665

Reviewed by Martin Robinson.

When we uploaded a video texture to the mapper we were not
considering that some videos could be decoded into a format
without alpha component. Now we check if the video has alpha and
if it does not, we remove the alpha flag when retrieving the
texture from the pool. For this, the method to get the texture
from the pool was modified to receive the flags, that is mapped to
have alpha by default in order not to break any other existing
code.

Though we have a problem with AC in WTR and that makes it
currently not testable, no new tests are needed because once this
is fixed the current test set suffices to detect a possible
regression in this.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Check
the video format and decide if the texture shall be pulled with
alpha support or not.
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::acquireTextureFromPool): Use the flags
when resetting the texture.
* platform/graphics/texmap/TextureMapper.h:
(WebCore::BitmapTexture::Flag::None): Added with 0x00.
(WebCore::TextureMapper::acquireTextureFromPool): Added flag
parameter to set up the texture with the default for including
alpha channel.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166479 => 166480)


--- trunk/Source/WebCore/ChangeLog	2014-03-31 06:39:25 UTC (rev 166479)
+++ trunk/Source/WebCore/ChangeLog	2014-03-31 06:39:51 UTC (rev 166480)
@@ -1,3 +1,37 @@
+2014-03-30  Xabier Rodriguez Calvar  <calva...@igalia.com>
+
+        [GTK] [TextureMapper] Weird brightness with some videos with acceletared compositing
+        https://bugs.webkit.org/show_bug.cgi?id=130665
+
+        Reviewed by Martin Robinson.
+
+        When we uploaded a video texture to the mapper we were not
+        considering that some videos could be decoded into a format
+        without alpha component. Now we check if the video has alpha and
+        if it does not, we remove the alpha flag when retrieving the
+        texture from the pool. For this, the method to get the texture
+        from the pool was modified to receive the flags, that is mapped to
+        have alpha by default in order not to break any other existing
+        code.
+
+        Though we have a problem with AC in WTR and that makes it
+        currently not testable, no new tests are needed because once this
+        is fixed the current test set suffices to detect a possible
+        regression in this.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Check
+        the video format and decide if the texture shall be pulled with
+        alpha support or not.
+        * platform/graphics/texmap/TextureMapper.cpp:
+        (WebCore::TextureMapper::acquireTextureFromPool): Use the flags
+        when resetting the texture.
+        * platform/graphics/texmap/TextureMapper.h:
+        (WebCore::BitmapTexture::Flag::None): Added with 0x00.
+        (WebCore::TextureMapper::acquireTextureFromPool): Added flag
+        parameter to set up the texture with the default for including
+        alpha channel.
+
 2014-03-30  Jinwoo Song  <jinwoo7.s...@samsung.com>
 
         Adopt range-based for loops to TextCheckerEnchant

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (166479 => 166480)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2014-03-31 06:39:25 UTC (rev 166479)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2014-03-31 06:39:51 UTC (rev 166480)
@@ -324,8 +324,10 @@
     if (!getVideoSizeAndFormatFromCaps(caps.get(), size, format, pixelAspectRatioNumerator, pixelAspectRatioDenominator, stride))
         return 0;
 
-    RefPtr<BitmapTexture> texture = textureMapper->acquireTextureFromPool(size);
+    const GstVideoFormatInfo* formatInfo = gst_video_format_get_info(format);
 
+    RefPtr<BitmapTexture> texture = textureMapper->acquireTextureFromPool(size, GST_VIDEO_FORMAT_INFO_HAS_ALPHA(formatInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
+
 #if GST_CHECK_VERSION(1, 1, 0)
     GstVideoGLTextureUploadMeta* meta;
     if ((meta = gst_buffer_get_video_gl_texture_upload_meta(m_buffer))) {

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp (166479 => 166480)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp	2014-03-31 06:39:25 UTC (rev 166479)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp	2014-03-31 06:39:51 UTC (rev 166480)
@@ -121,10 +121,10 @@
     return selectedEntry->m_texture;
 }
 
-PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size)
+PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size, const BitmapTexture::Flags flags)
 {
     RefPtr<BitmapTexture> selectedTexture = m_texturePool->acquireTexture(size, this);
-    selectedTexture->reset(size, BitmapTexture::SupportsAlpha);
+    selectedTexture->reset(size, flags);
     return selectedTexture;
 }
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h (166479 => 166480)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h	2014-03-31 06:39:25 UTC (rev 166479)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h	2014-03-31 06:39:51 UTC (rev 166480)
@@ -47,6 +47,7 @@
 class BitmapTexture : public RefCounted<BitmapTexture> {
 public:
     enum Flag {
+        NoFlag = 0,
         SupportsAlpha = 0x01
     };
 
@@ -156,7 +157,7 @@
 
     virtual IntSize maxTextureSize() const = 0;
 
-    virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&);
+    virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&, const BitmapTexture::Flags = BitmapTexture::SupportsAlpha);
 
     void setPatternTransform(const TransformationMatrix& p) { m_patternTransform = p; }
     void setWrapMode(WrapMode m) { m_wrapMode = m; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to