Changeset 220397 in webkit


Ignore:
Timestamp:
Aug 8, 2017 3:27:11 AM (7 years ago)
Author:
zandobersek@gmail.com
Message:

[TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
https://bugs.webkit.org/show_bug.cgi?id=175316

Reviewed by Carlos Garcia Campos.

Move the TextureMapperPlatformLayerProxyProvider class (which is the type
aliased to PlatformLayer for threaded CoordGraphics) into its own header
file. This prevents including the TextureMapperPlatformLayerProxy.h header
file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
and function declarations before the GStreamer GL headers include them
later in the MediaPlayerPrivateGStreamerBase implementation file.

In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
is included, and a forward declaration of the TextureMapperPlatformLayerProxy
class is used. proxy() and swapBuffersIfNeeded() methods are moved into
the implementation file to avoid requiring the full definition of the
TextureMapperPlatformLayerProxy class.

Similar is done for the TextureMapperGC3DPlatformLayer class and the
Cairo-specific implementation of the ImageBufferData class. The
CoordinatedGraphicsLayer implementation file also gains an include of the
TextureMapperPlatformLayerProxyProvider.h header since it requires the full
definition of that class.

No new tests -- no change in behavior.

  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::ImageBufferData::proxy const):

  • platform/graphics/cairo/ImageBufferDataCairo.h:
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
(WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
  • platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
  • platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
  • platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
  • platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
Location:
trunk/Source/WebCore
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r220396 r220397  
     12017-08-08  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
     4        https://bugs.webkit.org/show_bug.cgi?id=175316
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Move the TextureMapperPlatformLayerProxyProvider class (which is the type
     9        aliased to PlatformLayer for threaded CoordGraphics) into its own header
     10        file. This prevents including the TextureMapperPlatformLayerProxy.h header
     11        file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
     12        and function declarations before the GStreamer GL headers include them
     13        later in the MediaPlayerPrivateGStreamerBase implementation file.
     14
     15        In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
     16        is included, and a forward declaration of the TextureMapperPlatformLayerProxy
     17        class is used. proxy() and swapBuffersIfNeeded() methods are moved into
     18        the implementation file to avoid requiring the full definition of the
     19        TextureMapperPlatformLayerProxy class.
     20
     21        Similar is done for the TextureMapperGC3DPlatformLayer class and the
     22        Cairo-specific implementation of the ImageBufferData class. The
     23        CoordinatedGraphicsLayer implementation file also gains an include of the
     24        TextureMapperPlatformLayerProxyProvider.h header since it requires the full
     25        definition of that class.
     26
     27        No new tests -- no change in behavior.
     28
     29        * platform/graphics/cairo/ImageBufferCairo.cpp:
     30        (WebCore::ImageBufferData::proxy const):
     31        * platform/graphics/cairo/ImageBufferDataCairo.h:
     32        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     33        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
     34        (WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
     35        (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
     36        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
     37        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
     38        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
     39        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
     40        * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
     41        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     42
    1432017-08-08  Zan Dobersek  <zdobersek@igalia.com>
    244
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r219819 r220397  
    133133}
    134134
     135RefPtr<TextureMapperPlatformLayerProxy> ImageBufferData::proxy() const
     136{
     137    return m_platformLayerProxy.copyRef();
     138}
     139
    135140void ImageBufferData::swapBuffersIfNeeded()
    136141{
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h

    r199000 r220397  
    3636#include "TextureMapper.h"
    3737#include "TextureMapperPlatformLayer.h"
    38 #include "TextureMapperPlatformLayerProxy.h"
     38#include "TextureMapperPlatformLayerProxyProvider.h"
    3939#endif
    4040
     
    4242
    4343class IntSize;
     44class TextureMapperPlatformLayerProxy;
    4445
    4546class ImageBufferData
     
    6263
    6364#if USE(COORDINATED_GRAPHICS_THREADED)
    64     RefPtr<TextureMapperPlatformLayerProxy> proxy() const override { return m_platformLayerProxy.copyRef(); }
     65    RefPtr<TextureMapperPlatformLayerProxy> proxy() const;
    6566    void swapBuffersIfNeeded() override;
    6667    void createCompositorBuffer();
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r220396 r220397  
    105105#include "TextureMapperGL.h"
    106106#include "TextureMapperPlatformLayerBuffer.h"
     107#include "TextureMapperPlatformLayerProxy.h"
    107108#if USE(CAIRO) && ENABLE(ACCELERATED_2D_CANVAS)
    108109#include <cairo-gl.h>
     
    562563    gst_video_frame_unmap(&videoFrame);
    563564}
    564 #endif
    565 
    566 #if USE(TEXTURE_MAPPER_GL)
     565
     566RefPtr<TextureMapperPlatformLayerProxy> MediaPlayerPrivateGStreamerBase::proxy() const
     567{
     568    return m_platformLayerProxy.copyRef();
     569}
     570
     571void MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded()
     572{
     573}
     574
    567575void MediaPlayerPrivateGStreamerBase::pushTextureToCompositor()
    568576{
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

    r218799 r220397  
    3636#include <wtf/RunLoop.h>
    3737
    38 #if USE(TEXTURE_MAPPER)
    39 #include "TextureMapperPlatformLayerProxy.h"
     38#if USE(TEXTURE_MAPPER_GL)
     39#include "TextureMapperPlatformLayerProxyProvider.h"
    4040#endif
    4141
     
    5555class VideoTextureCopierGStreamer;
    5656
     57#if USE(TEXTURE_MAPPER_GL)
     58class TextureMapperPlatformLayerProxy;
     59#endif
     60
    5761void registerWebKitGStreamerElements();
    5862
     
    146150#if USE(TEXTURE_MAPPER_GL)
    147151    void updateTexture(BitmapTextureGL&, GstVideoInfo&);
    148     RefPtr<TextureMapperPlatformLayerProxy> proxy() const override { return m_platformLayerProxy.copyRef(); }
    149     void swapBuffersIfNeeded() override { };
     152    RefPtr<TextureMapperPlatformLayerProxy> proxy() const;
     153    void swapBuffersIfNeeded() override;
    150154    void pushTextureToCompositor();
    151155#endif
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp

    r219391 r220397  
    3434#include "GLContext.h"
    3535#include "TextureMapperPlatformLayerBuffer.h"
     36#include "TextureMapperPlatformLayerProxy.h"
    3637
    3738namespace WebCore {
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h

    r216483 r220397  
    2525#include "PlatformLayer.h"
    2626#include "TextureMapperPlatformLayer.h"
    27 #include "TextureMapperPlatformLayerProxy.h"
     27#include "TextureMapperPlatformLayerProxyProvider.h"
    2828
    2929namespace WebCore {
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h

    r218799 r220397  
    4545class TextureMapperGL;
    4646class TextureMapperLayer;
    47 class TextureMapperPlatformLayerProxy;
    4847class TextureMapperPlatformLayerBuffer;
    49 
    50 class TextureMapperPlatformLayerProxyProvider {
    51 public:
    52     virtual RefPtr<TextureMapperPlatformLayerProxy> proxy() const = 0;
    53     virtual void swapBuffersIfNeeded() = 0;
    54 };
    5548
    5649class TextureMapperPlatformLayerProxy : public ThreadSafeRefCounted<TextureMapperPlatformLayerProxy> {
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r216759 r220397  
    3232#include "GraphicsLayerFactory.h"
    3333#include "ScrollableArea.h"
     34#include "TextureMapperPlatformLayerProxyProvider.h"
    3435#include <wtf/CurrentTime.h>
    3536#ifndef NDEBUG
Note: See TracChangeset for help on using the changeset viewer.