Skip to content

Commit

Permalink
Merge r166480 - [GTK] [TextureMapper] Weird brightness with some vide…
Browse files Browse the repository at this point in the history
…os 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.
  • Loading branch information
calvaris authored and carlosgcampos committed Apr 30, 2014
1 parent 6407239 commit 90e328b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
34 changes: 34 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,37 @@
2014-03-30 Xabier Rodriguez Calvar <calvaris@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-03 Tomas Popela <tpopela@redhat.com>

[GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how parameter
Expand Down
Expand Up @@ -351,7 +351,9 @@ PassRefPtr<BitmapTexture> MediaPlayerPrivateGStreamerBase::updateTexture(Texture
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;
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
Expand Up @@ -122,10 +122,10 @@ PassRefPtr<BitmapTexture> BitmapTexturePool::acquireTexture(const IntSize& size,
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;
}

Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/platform/graphics/texmap/TextureMapper.h
Expand Up @@ -54,6 +54,7 @@ class FilterOperations;
class BitmapTexture : public RefCounted<BitmapTexture> {
public:
enum Flag {
NoFlag = 0,
SupportsAlpha = 0x01
};

Expand Down Expand Up @@ -163,7 +164,7 @@ class TextureMapper {

virtual IntSize maxTextureSize() const = 0;

virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&);
virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&, const BitmapTexture::Flags = BitmapTexture::SupportsAlpha);

#if ENABLE(CSS_SHADERS)
virtual void removeCachedCustomFilterProgram(CustomFilterProgram*) { }
Expand Down

0 comments on commit 90e328b

Please sign in to comment.