Title: [220397] trunk/Source/WebCore
Revision
220397
Author
zandober...@gmail.com
Date
2017-08-08 03:27:11 -0700 (Tue, 08 Aug 2017)

Log 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:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (220396 => 220397)


--- trunk/Source/WebCore/ChangeLog	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/ChangeLog	2017-08-08 10:27:11 UTC (rev 220397)
@@ -1,5 +1,47 @@
 2017-08-08  Zan Dobersek  <zdober...@igalia.com>
 
+        [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:
+
+2017-08-08  Zan Dobersek  <zdober...@igalia.com>
+
         Unreviewed. Follow-up to r220392 that fixes build on configurations
         that disable USE(GSTREAMER_GL).
 

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2017-08-08 10:27:11 UTC (rev 220397)
@@ -132,6 +132,11 @@
     cairo_set_antialias(m_compositorCr.get(), CAIRO_ANTIALIAS_NONE);
 }
 
+RefPtr<TextureMapperPlatformLayerProxy> ImageBufferData::proxy() const
+{
+    return m_platformLayerProxy.copyRef();
+}
+
 void ImageBufferData::swapBuffersIfNeeded()
 {
     GLContext* previousActiveContext = GLContext::current();

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h	2017-08-08 10:27:11 UTC (rev 220397)
@@ -35,12 +35,13 @@
 #include "PlatformLayer.h"
 #include "TextureMapper.h"
 #include "TextureMapperPlatformLayer.h"
-#include "TextureMapperPlatformLayerProxy.h"
+#include "TextureMapperPlatformLayerProxyProvider.h"
 #endif
 
 namespace WebCore {
 
 class IntSize;
+class TextureMapperPlatformLayerProxy;
 
 class ImageBufferData
 #if ENABLE(ACCELERATED_2D_CANVAS)
@@ -61,7 +62,7 @@
     void createCairoGLSurface();
 
 #if USE(COORDINATED_GRAPHICS_THREADED)
-    RefPtr<TextureMapperPlatformLayerProxy> proxy() const override { return m_platformLayerProxy.copyRef(); }
+    RefPtr<TextureMapperPlatformLayerProxy> proxy() const;
     void swapBuffersIfNeeded() override;
     void createCompositorBuffer();
 

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2017-08-08 10:27:11 UTC (rev 220397)
@@ -104,6 +104,7 @@
 #include "TextureMapperContextAttributes.h"
 #include "TextureMapperGL.h"
 #include "TextureMapperPlatformLayerBuffer.h"
+#include "TextureMapperPlatformLayerProxy.h"
 #if USE(CAIRO) && ENABLE(ACCELERATED_2D_CANVAS)
 #include <cairo-gl.h>
 #endif
@@ -561,9 +562,16 @@
     texture.updateContents(srcData, WebCore::IntRect(0, 0, GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)), WebCore::IntPoint(0, 0), stride, BitmapTexture::UpdateCannotModifyOriginalImageData);
     gst_video_frame_unmap(&videoFrame);
 }
-#endif
 
-#if USE(TEXTURE_MAPPER_GL)
+RefPtr<TextureMapperPlatformLayerProxy> MediaPlayerPrivateGStreamerBase::proxy() const
+{
+    return m_platformLayerProxy.copyRef();
+}
+
+void MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded()
+{
+}
+
 void MediaPlayerPrivateGStreamerBase::pushTextureToCompositor()
 {
 #if !USE(GSTREAMER_GL)

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h	2017-08-08 10:27:11 UTC (rev 220397)
@@ -35,8 +35,8 @@
 #include <wtf/Forward.h>
 #include <wtf/RunLoop.h>
 
-#if USE(TEXTURE_MAPPER)
-#include "TextureMapperPlatformLayerProxy.h"
+#if USE(TEXTURE_MAPPER_GL)
+#include "TextureMapperPlatformLayerProxyProvider.h"
 #endif
 
 typedef struct _GstStreamVolume GstStreamVolume;
@@ -54,6 +54,10 @@
 class IntRect;
 class VideoTextureCopierGStreamer;
 
+#if USE(TEXTURE_MAPPER_GL)
+class TextureMapperPlatformLayerProxy;
+#endif
+
 void registerWebKitGStreamerElements();
 
 class MediaPlayerPrivateGStreamerBase : public MediaPlayerPrivateInterface
@@ -145,8 +149,8 @@
 
 #if USE(TEXTURE_MAPPER_GL)
     void updateTexture(BitmapTextureGL&, GstVideoInfo&);
-    RefPtr<TextureMapperPlatformLayerProxy> proxy() const override { return m_platformLayerProxy.copyRef(); }
-    void swapBuffersIfNeeded() override { };
+    RefPtr<TextureMapperPlatformLayerProxy> proxy() const;
+    void swapBuffersIfNeeded() override;
     void pushTextureToCompositor();
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp	2017-08-08 10:27:11 UTC (rev 220397)
@@ -33,6 +33,7 @@
 #include "BitmapTextureGL.h"
 #include "GLContext.h"
 #include "TextureMapperPlatformLayerBuffer.h"
+#include "TextureMapperPlatformLayerProxy.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h	2017-08-08 10:27:11 UTC (rev 220397)
@@ -24,7 +24,7 @@
 #include "GraphicsContext3D.h"
 #include "PlatformLayer.h"
 #include "TextureMapperPlatformLayer.h"
-#include "TextureMapperPlatformLayerProxy.h"
+#include "TextureMapperPlatformLayerProxyProvider.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h	2017-08-08 10:27:11 UTC (rev 220397)
@@ -44,15 +44,8 @@
 class IntSize;
 class TextureMapperGL;
 class TextureMapperLayer;
-class TextureMapperPlatformLayerProxy;
 class TextureMapperPlatformLayerBuffer;
 
-class TextureMapperPlatformLayerProxyProvider {
-public:
-    virtual RefPtr<TextureMapperPlatformLayerProxy> proxy() const = 0;
-    virtual void swapBuffersIfNeeded() = 0;
-};
-
 class TextureMapperPlatformLayerProxy : public ThreadSafeRefCounted<TextureMapperPlatformLayerProxy> {
     WTF_MAKE_FAST_ALLOCATED();
 public:

Added: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h (0 => 220397)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h	2017-08-08 10:27:11 UTC (rev 220397)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(COORDINATED_GRAPHICS_THREADED)
+
+namespace WebCore {
+
+class TextureMapperPlatformLayerProxy;
+
+class TextureMapperPlatformLayerProxyProvider {
+public:
+    virtual RefPtr<TextureMapperPlatformLayerProxy> proxy() const = 0;
+    virtual void swapBuffersIfNeeded() = 0;
+};
+
+} // namespace WebCore
+
+#endif // USE(COORDINATED_GRAPHICS_THREADED)

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (220396 => 220397)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2017-08-08 09:03:40 UTC (rev 220396)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2017-08-08 10:27:11 UTC (rev 220397)
@@ -31,6 +31,7 @@
 #include "GraphicsLayer.h"
 #include "GraphicsLayerFactory.h"
 #include "ScrollableArea.h"
+#include "TextureMapperPlatformLayerProxyProvider.h"
 #include <wtf/CurrentTime.h>
 #ifndef NDEBUG
 #include <wtf/SetForScope.h>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to