Skip to content

Commit

Permalink
[TextureMapper] Merge TextureMapper and TextureMapperGL
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263961

Reviewed by Alejandro G. Castro.

GL is the only implementation of TextureMapper now, so we don't need to have both.

* Source/WebCore/platform/TextureMapper.cmake:
* Source/WebCore/platform/graphics/gstreamer/GStreamerVideoFrameHolder.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::updateTexture):
* Source/WebCore/platform/graphics/gstreamer/GStreamerVideoFrameHolder.h:
(WebCore::GstVideoFrameHolder::flags const):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::configureVideoDecoder):
(WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamer::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamer::setVideoSourceOrientation):
(WebCore::MediaPlayerPrivateGStreamer::updateTextureMapperFlags):
(WebCore::MediaPlayerPrivateGStreamer::pushNextHolePunchBuffer):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp:
(WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
* Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h:
* Source/WebCore/platform/graphics/nicosia/NicosiaImageBufferPipe.cpp:
(Nicosia::NicosiaImageBufferPipeSource::handle):
* Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
* Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::BitmapTexture):
(WebCore::BitmapTexture::didReset):
(WebCore::BitmapTexture::updateContents):
(WebCore::BitmapTexture::applyFilters):
(WebCore::BitmapTexture::initializeStencil):
(WebCore::BitmapTexture::initializeDepthBuffer):
(WebCore::BitmapTexture::clearIfNeeded):
(WebCore::BitmapTexture::createFboIfNeeded):
(WebCore::BitmapTexture::bindAsSurface):
(WebCore::BitmapTexture::~BitmapTexture):
(WebCore::BitmapTexture::isValid const):
(WebCore::BitmapTexture::size const):
(WebCore::BitmapTexture::copyFromExternalTexture):
* Source/WebCore/platform/graphics/texmap/BitmapTexture.h:
(WebCore::BitmapTexture::BitmapTexture): Deleted.
(WebCore::BitmapTexture::isBackedByOpenGL const): Deleted.
(WebCore::BitmapTexture::flags const): Deleted.
(WebCore::BitmapTexture::bpp const): Deleted.
(WebCore::BitmapTexture::reset): Deleted.
(WebCore::BitmapTexture::didReset): Deleted.
(WebCore::BitmapTexture::contentSize const): Deleted.
(WebCore::BitmapTexture::numberOfBytes const): Deleted.
(WebCore::BitmapTexture::isOpaque const): Deleted.
(WebCore::BitmapTexture::applyFilters): Deleted.
* Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp: Removed.
* Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h: Removed.
* Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::BitmapTexturePool):
(WebCore::BitmapTexturePool::createTexture):
* Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h:
* Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
(WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
(WebCore::TextureMapperGLData::SharedGLData::contextDataMap):
(WebCore::TextureMapperGLData::TextureMapperGLData):
(WebCore::TextureMapperGLData::~TextureMapperGLData):
(WebCore::TextureMapperGLData::initializeStencil):
(WebCore::TextureMapperGLData::getStaticVBO):
(WebCore::TextureMapperGLData::getVAO):
(WebCore::TextureMapperGLData::getShaderProgram):
(WebCore::TextureMapper::create):
(WebCore::TextureMapper::TextureMapper):
(WebCore::TextureMapper::clipStack):
(WebCore::TextureMapper::beginPainting):
(WebCore::TextureMapper::endPainting):
(WebCore::TextureMapper::drawBorder):
(WebCore::TextureMapper::drawNumber):
(WebCore::optionsForFilterType):
(WebCore::blurRadiusToKernelHalfSize):
(WebCore::kernelHalfSizeToBlurRadius):
(WebCore::kernelHalfSizeToSimplifiedKernelHalfSize):
(WebCore::gauss):
(WebCore::computeGaussianKernel):
(WebCore::prepareFilterProgram):
(WebCore::colorSpaceMatrixForFlags):
(WebCore::prepareRoundedRectClip):
(WebCore::TextureMapper::drawTexture):
(WebCore::prepareTransformationMatrixWithFlags):
(WebCore::TextureMapper::drawTexturePlanarYUV):
(WebCore::TextureMapper::drawTextureSemiPlanarYUV):
(WebCore::TextureMapper::drawTexturePackedYUV):
(WebCore::TextureMapper::drawSolidColor):
(WebCore::TextureMapper::clearColor):
(WebCore::TextureMapper::drawEdgeTriangles):
(WebCore::TextureMapper::drawUnitRect):
(WebCore::TextureMapper::draw):
(WebCore::TextureMapper::drawTexturedQuadWithProgram):
(WebCore::TextureMapper::drawTextureCopy):
(WebCore::TextureMapper::drawBlurred):
(WebCore::TextureMapper::applyBlurFilter):
(WebCore::TextureMapper::applyDropShadowFilter):
(WebCore::TextureMapper::applySinglePassFilter):
(WebCore::TextureMapper::applyFilter):
(WebCore::createProjectionMatrix):
(WebCore::TextureMapper::~TextureMapper):
(WebCore::TextureMapper::bindDefaultSurface):
(WebCore::TextureMapper::bindSurface):
(WebCore::TextureMapper::currentSurface):
(WebCore::TextureMapper::beginScissorClip):
(WebCore::TextureMapper::beginRoundedRectClip):
(WebCore::TextureMapper::beginClip):
(WebCore::TextureMapper::endClip):
(WebCore::TextureMapper::clipBounds):
(WebCore::TextureMapper::createTexture):
(WebCore::TextureMapper::setDepthRange):
(WebCore::TextureMapper::updateProjectionMatrix):
(WebCore::TextureMapper::drawTextureExternalOES):
* Source/WebCore/platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::maxTextureSize const):
(WebCore::TextureMapper::setWrapMode):
(WebCore::TextureMapper::setPatternTransform):
(WebCore::TextureMapper::data):
(WebCore::TextureMapper::beginPainting): Deleted.
(WebCore::TextureMapper::endPainting): Deleted.
(WebCore::TextureMapper::platformCreateAccelerated): Deleted.
* Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp:
* Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp: Removed.
* Source/WebCore/platform/graphics/texmap/TextureMapperGL.h: Removed.
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
(WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
(WebCore::TextureMapperPlatformLayerBuffer::clone):
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::texture):
(WebCore::TextureMapperPlatformLayerBuffer::setExtraFlags):
(WebCore::TextureMapperPlatformLayerBuffer::textureGL): Deleted.
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::DMABufLayer):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyGL.cpp:
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp:
(WebCore::TextureMapperTile::TextureMapperTile):
(WebCore::TextureMapperTile::texture const):
(WebCore::TextureMapperTile::setTexture):
* Source/WebCore/platform/graphics/texmap/TextureMapperTile.h:
(WebCore::TextureMapperTile::texture const): Deleted.
(WebCore::TextureMapperTile::setTexture): Deleted.
(WebCore::TextureMapperTile::TextureMapperTile): Deleted.
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
* Source/WebKit/GPUProcess/graphics/wc/WCSceneContext.cpp:
(WebKit::WCSceneContext::createTextureMapper):
* Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
* Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Source/WebKit/WebProcess/GPU/graphics/gbm/RemoteGraphicsContextGLProxyGBM.cpp:
(WebKit::NicosiaDisplayDelegate::swapBuffersIfNeeded):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp:
(WebKit::LayerTreeHost::LayerTreeHost):
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:

Canonical link: https://commits.webkit.org/270048@main
  • Loading branch information
carlosgcampos committed Nov 1, 2023
1 parent 376fed9 commit 9860d77
Show file tree
Hide file tree
Showing 45 changed files with 1,920 additions and 2,187 deletions.
14 changes: 3 additions & 11 deletions Source/WebCore/platform/TextureMapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ list(APPEND WebCore_SOURCES

platform/graphics/texmap/BitmapTexture.cpp
platform/graphics/texmap/BitmapTexturePool.cpp
platform/graphics/texmap/ClipStack.cpp
platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp
platform/graphics/texmap/TextureMapper.cpp
platform/graphics/texmap/TextureMapperBackingStore.cpp
platform/graphics/texmap/TextureMapperContextAttributes.cpp
platform/graphics/texmap/TextureMapperFPSCounter.cpp
platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp
platform/graphics/texmap/TextureMapperLayer.cpp
platform/graphics/texmap/TextureMapperShaderProgram.cpp
platform/graphics/texmap/TextureMapperTile.cpp
)

Expand All @@ -28,7 +31,6 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS
platform/graphics/texmap/TextureMapperBackingStore.h
platform/graphics/texmap/TextureMapperContextAttributes.h
platform/graphics/texmap/TextureMapperFPSCounter.h
platform/graphics/texmap/TextureMapperGL.h
platform/graphics/texmap/TextureMapperGLHeaders.h
platform/graphics/texmap/TextureMapperLayer.h
platform/graphics/texmap/TextureMapperPlatformLayer.h
Expand All @@ -40,16 +42,6 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS
platform/graphics/texmap/TextureMapperTiledBackingStore.h
)

if (USE_TEXTURE_MAPPER_GL)
list(APPEND WebCore_SOURCES
platform/graphics/texmap/BitmapTextureGL.cpp
platform/graphics/texmap/ClipStack.cpp
platform/graphics/texmap/TextureMapperContextAttributes.cpp
platform/graphics/texmap/TextureMapperGL.cpp
platform/graphics/texmap/TextureMapperShaderProgram.cpp
)
endif ()

if (USE_TEXTURE_MAPPER_DMABUF)
list(APPEND WebCore_SOURCES
platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@

#include "config.h"

#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(TEXTURE_MAPPER_GL)
#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(TEXTURE_MAPPER)
#include "GStreamerVideoFrameHolder.h"

#include "BitmapTextureGL.h"
#include "BitmapTexture.h"
#include "BitmapTexturePool.h"
#include "TextureMapper.h"
#include "TextureMapperContextAttributes.h"
#include "TextureMapperGL.h"

namespace WebCore {

GstVideoFrameHolder::GstVideoFrameHolder(GstSample* sample, std::optional<GstVideoDecoderPlatform> videoDecoderPlatform, TextureMapperGL::Flags flags, bool gstGLEnabled)
GstVideoFrameHolder::GstVideoFrameHolder(GstSample* sample, std::optional<GstVideoDecoderPlatform> videoDecoderPlatform, TextureMapper::Flags flags, bool gstGLEnabled)
: m_videoDecoderPlatform(videoDecoderPlatform)
{
RELEASE_ASSERT(GST_IS_SAMPLE(sample));
Expand All @@ -46,7 +46,7 @@ GstVideoFrameHolder::GstVideoFrameHolder(GstSample* sample, std::optional<GstVid
return;

#if USE(GSTREAMER_GL)
m_flags = flags | (m_hasAlphaChannel ? TextureMapperGL::ShouldBlend | TextureMapperGL::ShouldPremultiply : 0);
m_flags = flags | (m_hasAlphaChannel ? TextureMapper::ShouldBlend | TextureMapper::ShouldPremultiply : 0);

GstMemory* memory = gst_buffer_peek_memory(m_buffer.get(), 0);
if (gst_is_gl_memory(memory))
Expand Down Expand Up @@ -98,7 +98,7 @@ void GstVideoFrameHolder::waitForCPUSync()
}
#endif // USE(GSTREAMER_GL)

void GstVideoFrameHolder::updateTexture(BitmapTextureGL& texture)
void GstVideoFrameHolder::updateTexture(BitmapTexture& texture)
{
ASSERT(!m_textureID);
GstVideoGLTextureUploadMeta* meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(TEXTURE_MAPPER_GL)
#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(TEXTURE_MAPPER)

#include "MediaPlayerPrivateGStreamer.h"
#include "TextureMapperPlatformLayerBuffer.h"
Expand All @@ -29,7 +29,7 @@ namespace WebCore {

class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBufferDataHolder {
public:
explicit GstVideoFrameHolder(GstSample*, std::optional<GstVideoDecoderPlatform>, TextureMapperGL::Flags, bool gstGLEnabled);
explicit GstVideoFrameHolder(GstSample*, std::optional<GstVideoDecoderPlatform>, TextureMapper::Flags, bool gstGLEnabled);
virtual ~GstVideoFrameHolder();

#if USE(GSTREAMER_GL)
Expand All @@ -38,11 +38,11 @@ class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBu

const IntSize& size() const { return m_size; }
bool hasAlphaChannel() const { return m_hasAlphaChannel; }
TextureMapperGL::Flags flags() const { return m_flags; }
TextureMapper::Flags flags() const { return m_flags; }
GLuint textureID() const { return m_textureID; }
bool hasMappedTextures() const { return m_hasMappedTextures; }
const GstVideoFrame& videoFrame() const { return m_videoFrame; }
void updateTexture(BitmapTextureGL&);
void updateTexture(BitmapTexture&);
std::unique_ptr<TextureMapperPlatformLayerBuffer> platformLayerBuffer();

bool hasDMABuf() const { return false; }
Expand All @@ -53,7 +53,7 @@ class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBu
IntSize m_size;
bool m_hasAlphaChannel;
std::optional<GstVideoDecoderPlatform> m_videoDecoderPlatform;
TextureMapperGL::Flags m_flags { };
TextureMapper::Flags m_flags { };
GLuint m_textureID { 0 };
#if USE(GSTREAMER_GL)
GstGLTextureTarget m_textureTarget { GST_GL_TEXTURE_TARGET_NONE };
Expand All @@ -62,6 +62,7 @@ class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBu
bool m_hasMappedTextures { false };
};

}
#endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(TEXTURE_MAPPER_GL)
} // namespace WebCore

#endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(TEXTURE_MAPPER)

Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@
#include "GLVideoSinkGStreamer.h"
#endif // USE(GSTREAMER_GL)

#if USE(TEXTURE_MAPPER_GL)
#include "BitmapTextureGL.h"
#if USE(TEXTURE_MAPPER)
#include "BitmapTexture.h"
#include "BitmapTexturePool.h"
#include "GStreamerVideoFrameHolder.h"
#include "TextureMapperContextAttributes.h"
#include "TextureMapperPlatformLayerBuffer.h"
#include "TextureMapperPlatformLayerProxyGL.h"
#endif // USE(TEXTURE_MAPPER_GL)
#endif // USE(TEXTURE_MAPPER)

#if USE(TEXTURE_MAPPER_DMABUF)
#include "DMABufFormat.h"
Expand Down Expand Up @@ -152,7 +152,7 @@ MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer(MediaPlayer* player)
, m_maxTimeLoadedAtLastDidLoadingProgress(MediaTime::zeroTime())
, m_drawTimer(RunLoop::main(), this, &MediaPlayerPrivateGStreamer::repaint)
, m_readyTimerHandler(RunLoop::main(), this, &MediaPlayerPrivateGStreamer::readyTimerFired)
#if USE(TEXTURE_MAPPER_GL) && !USE(NICOSIA)
#if USE(TEXTURE_MAPPER) && !USE(NICOSIA)
, m_platformLayerProxy(adoptRef(new TextureMapperPlatformLayerProxyGL))
#endif
#if !RELEASE_LOG_DISABLED
Expand All @@ -169,7 +169,7 @@ MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer(MediaPlayer* player)
#endif
m_isPlayerShuttingDown.store(false);

#if USE(TEXTURE_MAPPER_GL) && USE(NICOSIA)
#if USE(TEXTURE_MAPPER) && USE(NICOSIA)
m_nicosiaLayer = Nicosia::ContentLayer::create(*this,
[&]() -> Ref<TextureMapperPlatformLayerProxy> {
#if USE(TEXTURE_MAPPER_DMABUF)
Expand Down Expand Up @@ -220,7 +220,7 @@ MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
if (m_videoDecoderPlatform == GstVideoDecoderPlatform::Video4Linux)
flushCurrentBuffer();
#endif
#if USE(TEXTURE_MAPPER_GL) && USE(NICOSIA)
#if USE(TEXTURE_MAPPER) && USE(NICOSIA)
m_nicosiaLayer->invalidateClient();
#endif

Expand Down Expand Up @@ -3103,7 +3103,7 @@ void MediaPlayerPrivateGStreamer::configureVideoDecoder(GstElement* decoder)
if (gstObjectHasProperty(decoder, "max-threads"))
g_object_set(decoder, "max-threads", 2, nullptr);
}
#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
updateTextureMapperFlags();
#endif

Expand Down Expand Up @@ -3216,7 +3216,7 @@ void MediaPlayerPrivateGStreamer::isLoopingChanged()
ensureSeekFlags();
}

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
PlatformLayer* MediaPlayerPrivateGStreamer::platformLayer() const
{
#if USE(NICOSIA)
Expand Down Expand Up @@ -3265,12 +3265,12 @@ void MediaPlayerPrivateGStreamer::pushTextureToCompositor()
} else {
layerBuffer = proxy.getAvailableBuffer(frameHolder->size(), GL_DONT_CARE);
if (UNLIKELY(!layerBuffer)) {
auto texture = BitmapTextureGL::create(TextureMapperContextAttributes::get());
auto texture = BitmapTexture::create(TextureMapperContextAttributes::get());
texture->reset(frameHolder->size(), frameHolder->hasAlphaChannel() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
layerBuffer = makeUnique<TextureMapperPlatformLayerBuffer>(WTFMove(texture));
}
frameHolder->updateTexture(layerBuffer->textureGL());
layerBuffer->setExtraFlags(m_textureMapperFlags | (frameHolder->hasAlphaChannel() ? TextureMapperGL::ShouldBlend | TextureMapperGL::ShouldPremultiply : 0));
frameHolder->updateTexture(layerBuffer->texture());
layerBuffer->setExtraFlags(m_textureMapperFlags | (frameHolder->hasAlphaChannel() ? TextureMapper::ShouldBlend | TextureMapper::ShouldPremultiply : 0));
}
proxy.pushNextBuffer(WTFMove(layerBuffer));
};
Expand All @@ -3295,7 +3295,7 @@ void MediaPlayerPrivateGStreamer::pushTextureToCompositor()
proxyOperation(*m_platformLayerProxy);
#endif
}
#endif // USE(TEXTURE_MAPPER_GL)
#endif // USE(TEXTURE_MAPPER)

#if USE(TEXTURE_MAPPER_DMABUF)
// GStreamer's gst_video_format_to_fourcc() doesn't cover RGB-like formats, so we
Expand Down Expand Up @@ -3752,7 +3752,7 @@ void MediaPlayerPrivateGStreamer::triggerRepaint(GRefPtr<GstSample>&& sample)
return;
}

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
if (m_isUsingFallbackVideoSink) {
Locker locker { m_drawLock };
auto proxyOperation =
Expand Down Expand Up @@ -3781,7 +3781,7 @@ void MediaPlayerPrivateGStreamer::triggerRepaint(GRefPtr<GstSample>&& sample)

pushTextureToCompositor();
}
#endif // USE(TEXTURE_MAPPER_GL)
#endif // USE(TEXTURE_MAPPER)
}

void MediaPlayerPrivateGStreamer::cancelRepaint(bool destroying)
Expand Down Expand Up @@ -3927,30 +3927,30 @@ bool MediaPlayerPrivateGStreamer::setVideoSourceOrientation(ImageOrientation ori
return false;

m_videoSourceOrientation = orientation;
#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
updateTextureMapperFlags();
#endif
return true;
}

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
void MediaPlayerPrivateGStreamer::updateTextureMapperFlags()
{
switch (m_videoSourceOrientation.orientation()) {
case ImageOrientation::Orientation::OriginTopLeft:
m_textureMapperFlags = 0;
break;
case ImageOrientation::Orientation::OriginRightTop:
m_textureMapperFlags = TextureMapperGL::ShouldRotateTexture90;
m_textureMapperFlags = TextureMapper::ShouldRotateTexture90;
break;
case ImageOrientation::Orientation::OriginBottomRight:
m_textureMapperFlags = TextureMapperGL::ShouldRotateTexture180;
m_textureMapperFlags = TextureMapper::ShouldRotateTexture180;
break;
case ImageOrientation::Orientation::OriginLeftBottom:
m_textureMapperFlags = TextureMapperGL::ShouldRotateTexture270;
m_textureMapperFlags = TextureMapper::ShouldRotateTexture270;
break;
case ImageOrientation::Orientation::OriginBottomLeft:
m_textureMapperFlags = TextureMapperGL::ShouldFlipTexture;
m_textureMapperFlags = TextureMapper::ShouldFlipTexture;
break;
default:
// FIXME: Handle OriginTopRight, OriginLeftTop and OriginRightBottom.
Expand Down Expand Up @@ -4080,7 +4080,7 @@ void MediaPlayerPrivateGStreamer::pushNextHolePunchBuffer()
[this](TextureMapperPlatformLayerProxyGL& proxy)
{
Locker locker { proxy.lock() };
std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = makeUnique<TextureMapperPlatformLayerBuffer>(0, m_size, TextureMapperGL::ShouldNotBlend, GL_DONT_CARE);
std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = makeUnique<TextureMapperPlatformLayerBuffer>(0, m_size, TextureMapper::ShouldNotBlend, GL_DONT_CARE);
std::unique_ptr<GStreamerHolePunchClient> holePunchClient = makeUnique<GStreamerHolePunchClient>(m_videoSink.get());
layerBuffer->setHolePunchClient(WTFMove(holePunchClient));
proxy.pushNextBuffer(WTFMove(layerBuffer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ typedef struct _GstMpegtsSection GstMpegtsSection;
#undef GST_USE_UNSTABLE_API
#endif

#if USE(TEXTURE_MAPPER_GL)
#include "TextureMapperGL.h"
#if USE(TEXTURE_MAPPER)
#include "TextureMapper.h"
#if USE(NICOSIA)
#include "NicosiaContentLayer.h"
#else
Expand All @@ -77,14 +77,14 @@ typedef struct _GstVideoInfo GstVideoInfo;

namespace WebCore {

class BitmapTextureGL;
class BitmapTexture;
class GLContext;
class GraphicsContext;
class GraphicsContextGL;
class IntSize;
class IntRect;

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
class TextureMapperPlatformLayerProxy;
#endif

Expand All @@ -110,7 +110,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
#if !RELEASE_LOG_DISABLED
, private LoggerHelper
#endif
#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
#if USE(NICOSIA)
, public Nicosia::ContentLayer::Client
#else
Expand Down Expand Up @@ -187,7 +187,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
bool performTaskAtMediaTime(Function<void()>&&, const MediaTime&) override;
void isLoopingChanged() final;

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
PlatformLayer* platformLayer() const override;
#if PLATFORM(WIN)
// FIXME: Accelerated rendering has not been implemented for WinCairo yet.
Expand Down Expand Up @@ -285,7 +285,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
GstElement* createVideoSinkGL();
#endif

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
void pushTextureToCompositor();
#if USE(NICOSIA)
void swapBuffersIfNeeded() final;
Expand Down Expand Up @@ -333,7 +333,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
void loadingFailed(MediaPlayer::NetworkState, MediaPlayer::ReadyState = MediaPlayer::ReadyState::HaveNothing, bool forceNotifications = false);
void loadStateChanged();

#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
void updateTextureMapperFlags();
#endif

Expand Down Expand Up @@ -373,8 +373,8 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
GRefPtr<GstElement> m_source { nullptr };
bool m_areVolumeAndMuteInitialized { false };

#if USE(TEXTURE_MAPPER_GL)
TextureMapperGL::Flags m_textureMapperFlags { TextureMapperGL::NoFlag };
#if USE(TEXTURE_MAPPER)
TextureMapper::Flags m_textureMapperFlags { TextureMapper::NoFlag };
#endif

GRefPtr<GstStreamVolume> m_volumeElement;
Expand Down Expand Up @@ -544,7 +544,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface
Lock m_drawLock;
RunLoop::Timer m_drawTimer WTF_GUARDED_BY_LOCK(m_drawLock);
RunLoop::Timer m_readyTimerHandler;
#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
#if USE(NICOSIA)
RefPtr<Nicosia::ContentLayer> m_nicosiaLayer;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer()
[this](TextureMapperPlatformLayerProxyGL& proxy)
{
Locker locker { proxy.lock() };
std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = makeUnique<TextureMapperPlatformLayerBuffer>(0, m_size, TextureMapperGL::ShouldNotBlend, GL_DONT_CARE);
std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = makeUnique<TextureMapperPlatformLayerBuffer>(0, m_size, TextureMapper::ShouldNotBlend, GL_DONT_CARE);
proxy.pushNextBuffer(WTFMove(layerBuffer));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class MediaPlayerPrivateHolePunch : public MediaPlayerPrivateInterface, public C
IntSize m_size;
RunLoop::Timer m_readyTimer;
MediaPlayer::NetworkState m_networkState;
#if USE(TEXTURE_MAPPER_GL)
#if USE(TEXTURE_MAPPER)
#if USE(NICOSIA)
Ref<Nicosia::ContentLayer> m_nicosiaLayer;
#else
Expand Down
Loading

0 comments on commit 9860d77

Please sign in to comment.