Changeset 166480 in webkit


Ignore:
Timestamp:
Mar 30, 2014 11:39:51 PM (10 years ago)
Author:
calvaris@igalia.com
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.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166474 r166480  
     12014-03-30  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GTK] [TextureMapper] Weird brightness with some videos with acceletared compositing
     4        https://bugs.webkit.org/show_bug.cgi?id=130665
     5
     6        Reviewed by Martin Robinson.
     7
     8        When we uploaded a video texture to the mapper we were not
     9        considering that some videos could be decoded into a format
     10        without alpha component. Now we check if the video has alpha and
     11        if it does not, we remove the alpha flag when retrieving the
     12        texture from the pool. For this, the method to get the texture
     13        from the pool was modified to receive the flags, that is mapped to
     14        have alpha by default in order not to break any other existing
     15        code.
     16
     17        Though we have a problem with AC in WTR and that makes it
     18        currently not testable, no new tests are needed because once this
     19        is fixed the current test set suffices to detect a possible
     20        regression in this.
     21
     22        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     23        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Check
     24        the video format and decide if the texture shall be pulled with
     25        alpha support or not.
     26        * platform/graphics/texmap/TextureMapper.cpp:
     27        (WebCore::TextureMapper::acquireTextureFromPool): Use the flags
     28        when resetting the texture.
     29        * platform/graphics/texmap/TextureMapper.h:
     30        (WebCore::BitmapTexture::Flag::None): Added with 0x00.
     31        (WebCore::TextureMapper::acquireTextureFromPool): Added flag
     32        parameter to set up the texture with the default for including
     33        alpha channel.
     34
    1352014-03-30  Jinwoo Song  <jinwoo7.song@samsung.com>
    236
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r166055 r166480  
    325325        return 0;
    326326
    327     RefPtr<BitmapTexture> texture = textureMapper->acquireTextureFromPool(size);
     327    const GstVideoFormatInfo* formatInfo = gst_video_format_get_info(format);
     328
     329    RefPtr<BitmapTexture> texture = textureMapper->acquireTextureFromPool(size, GST_VIDEO_FORMAT_INFO_HAS_ALPHA(formatInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
    328330
    329331#if GST_CHECK_VERSION(1, 1, 0)
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp

    r163079 r166480  
    122122}
    123123
    124 PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size)
     124PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size, const BitmapTexture::Flags flags)
    125125{
    126126    RefPtr<BitmapTexture> selectedTexture = m_texturePool->acquireTexture(size, this);
    127     selectedTexture->reset(size, BitmapTexture::SupportsAlpha);
     127    selectedTexture->reset(size, flags);
    128128    return selectedTexture;
    129129}
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h

    r163079 r166480  
    4848public:
    4949    enum Flag {
     50        NoFlag = 0,
    5051        SupportsAlpha = 0x01
    5152    };
     
    157158    virtual IntSize maxTextureSize() const = 0;
    158159
    159     virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&);
     160    virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&, const BitmapTexture::Flags = BitmapTexture::SupportsAlpha);
    160161
    161162    void setPatternTransform(const TransformationMatrix& p) { m_patternTransform = p; }
Note: See TracChangeset for help on using the changeset viewer.