[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
noam.rosenthal at nokia.com
noam.rosenthal at nokia.com
Wed Dec 22 14:38:00 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 452ce982aa65d7e80dfd6b6a29d1408742c6f47f
Author: noam.rosenthal at nokia.com <noam.rosenthal at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 14 16:52:57 2010 +0000
2010-10-14 No'am Rosenthal <noam.rosenthal at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
[Texmap] [Qt] Texture mapper initial implementation
https://bugs.webkit.org/show_bug.cgi?id=47070
This patch enables compilation of TextureMapper with Media. It has an initial non-working implementation of a video layer, to be integrated
once other parts of TextureMapper are fully working.
No new tests: this is new implementation that's not enabled yet.
* platform/graphics/qt/MediaPlayerPrivateQt.cpp:
(WebCore::TextureMapperVideoLayerQt::TextureMapperVideoLayerQt):
(WebCore::TextureMapperVideoLayerQt::setPlatformLayerClient):
(WebCore::TextureMapperVideoLayerQt::paint):
(WebCore::TextureMapperVideoLayerQt::size):
(WebCore::MediaPlayerPrivateQt::acceleratedRenderingStateChanged):
(WebCore::MediaPlayerPrivateQt::platformLayer):
* platform/graphics/qt/MediaPlayerPrivateQt.h:
(WebCore::MediaPlayerPrivateQt::supportsAcceleratedRendering):
(WebCore::MediaPlayerPrivateQt::acceleratedRenderingStateChanged):
(WebCore::MediaPlayerPrivateQt::platformLayer):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 50d81b6..f923bd9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-14 No'am Rosenthal <noam.rosenthal at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ This patch enables compilation of TextureMapper with Media. It has an initial non-working implementation of a video layer, to be integrated
+ once other parts of TextureMapper are fully working.
+
+ No new tests: this is new implementation that's not enabled yet.
+
+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+ (WebCore::TextureMapperVideoLayerQt::TextureMapperVideoLayerQt):
+ (WebCore::TextureMapperVideoLayerQt::setPlatformLayerClient):
+ (WebCore::TextureMapperVideoLayerQt::paint):
+ (WebCore::TextureMapperVideoLayerQt::size):
+ (WebCore::MediaPlayerPrivateQt::acceleratedRenderingStateChanged):
+ (WebCore::MediaPlayerPrivateQt::platformLayer):
+ * platform/graphics/qt/MediaPlayerPrivateQt.h:
+ (WebCore::MediaPlayerPrivateQt::supportsAcceleratedRendering):
+ (WebCore::MediaPlayerPrivateQt::acceleratedRenderingStateChanged):
+ (WebCore::MediaPlayerPrivateQt::platformLayer):
+
2010-10-14 Alejandro G. Castro <alex at igalia.com>
Reviewed by Martin Robinson.
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
index f5cd71a..962c931 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -43,6 +43,7 @@
#include <QPainter>
#include <QPoint>
#include <QRect>
+#include <QStyleOptionGraphicsItem>
#include <QTime>
#include <QTimer>
#include <QUrl>
@@ -50,6 +51,10 @@
#include <wtf/HashSet.h>
#include <wtf/text/CString.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include "texmap/TextureMapperPlatformLayer.h"
+#endif
+
using namespace WTF;
namespace WebCore {
@@ -602,7 +607,41 @@ void MediaPlayerPrivateQt::repaint()
m_webCorePlayer->repaint();
}
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+
+class TextureMapperVideoLayerQt : public virtual TextureMapperVideoLayer {
+public:
+ TextureMapperVideoLayerQt(QGraphicsVideoItem* videoItem)
+ : m_videoItem(videoItem)
+ {
+ }
+
+ virtual void setPlatformLayerClient(TextureMapperLayerClient* client)
+ {
+ m_client = client;
+ }
+
+ virtual void paint(GraphicsContext* context)
+ {
+ if (!m_videoItem)
+ return;
+
+ QStyleOptionGraphicsItem opt;
+ opt.exposedRect = m_videoItem.data()->sceneBoundingRect();
+ opt.rect = opt.exposedRect.toRect();
+ m_videoItem.data()->paint(context->platformContext(), &opt);
+ }
+
+ virtual IntSize size() const
+ {
+ return m_videoItem ? IntSize(m_videoItem.data()->size().width(), m_videoItem.data()->size().height()) : IntSize();
+ }
+
+ QWeakPointer<QGraphicsVideoItem> m_videoItem;
+ TextureMapperLayerClient* m_client;
+};
+
+
void MediaPlayerPrivateQt::acceleratedRenderingStateChanged()
{
MediaPlayerClient* client = m_webCorePlayer->mediaPlayerClient();
@@ -612,14 +651,12 @@ void MediaPlayerPrivateQt::acceleratedRenderingStateChanged()
m_composited = composited;
if (composited)
- m_videoScene->removeItem(m_videoItem);
- else
- m_videoScene->addItem(m_videoItem);
+ m_platformLayer = new TextureMapperVideoLayerQt(m_videoItem);
}
PlatformLayer* MediaPlayerPrivateQt::platformLayer() const
{
- return m_composited ? m_videoItem : 0;
+ return m_composited ? m_platformLayer.get() : 0;
}
#endif
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
index ba85f8f..93c9d1c 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -33,6 +33,8 @@ QT_END_NAMESPACE
namespace WebCore {
+class TextureMapperVideoLayer;
+
class MediaPlayerPrivateQt : public QObject, public MediaPlayerPrivateInterface {
Q_OBJECT
@@ -91,12 +93,18 @@ public:
bool supportsFullscreen() const { return false; }
#if USE(ACCELERATED_COMPOSITING)
+#if USE(TEXTURE_MAPPER)
// whether accelerated rendering is supported by the media engine for the current media.
virtual bool supportsAcceleratedRendering() const { return true; }
// called when the rendering system flips the into or out of accelerated rendering mode.
virtual void acceleratedRenderingStateChanged();
// returns an object that can be directly composited via GraphicsLayerQt (essentially a QGraphicsItem*)
virtual PlatformLayer* platformLayer() const;
+#else
+ virtual bool supportsAcceleratedRendering() const { return false; }
+ virtual void acceleratedRenderingStateChanged() { }
+ virtual PlatformLayer* platformLayer() const { return 0; }
+#endif
#endif
virtual PlatformMedia platformMedia() const;
@@ -125,6 +133,9 @@ private:
QMediaPlayerControl* m_mediaPlayerControl;
QGraphicsVideoItem* m_videoItem;
QGraphicsScene* m_videoScene;
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ OwnPtr<TextureMapperVideoLayer> m_platformLayer;
+#endif
mutable MediaPlayer::NetworkState m_networkState;
mutable MediaPlayer::ReadyState m_readyState;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list