Changeset 69772 in webkit
- Timestamp:
- Oct 14, 2010 9:52:57 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r69768 r69772 1 2010-10-14 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Texmap] [Qt] Texture mapper initial implementation 6 https://bugs.webkit.org/show_bug.cgi?id=47070 7 8 This patch enables compilation of TextureMapper with Media. It has an initial non-working implementation of a video layer, to be integrated 9 once other parts of TextureMapper are fully working. 10 11 No new tests: this is new implementation that's not enabled yet. 12 13 * platform/graphics/qt/MediaPlayerPrivateQt.cpp: 14 (WebCore::TextureMapperVideoLayerQt::TextureMapperVideoLayerQt): 15 (WebCore::TextureMapperVideoLayerQt::setPlatformLayerClient): 16 (WebCore::TextureMapperVideoLayerQt::paint): 17 (WebCore::TextureMapperVideoLayerQt::size): 18 (WebCore::MediaPlayerPrivateQt::acceleratedRenderingStateChanged): 19 (WebCore::MediaPlayerPrivateQt::platformLayer): 20 * platform/graphics/qt/MediaPlayerPrivateQt.h: 21 (WebCore::MediaPlayerPrivateQt::supportsAcceleratedRendering): 22 (WebCore::MediaPlayerPrivateQt::acceleratedRenderingStateChanged): 23 (WebCore::MediaPlayerPrivateQt::platformLayer): 24 1 25 2010-10-14 Alejandro G. Castro <alex@igalia.com> 2 26 -
trunk/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
r69291 r69772 44 44 #include <QPoint> 45 45 #include <QRect> 46 #include <QStyleOptionGraphicsItem> 46 47 #include <QTime> 47 48 #include <QTimer> … … 50 51 #include <wtf/HashSet.h> 51 52 #include <wtf/text/CString.h> 53 54 #if USE(ACCELERATED_COMPOSITING) 55 #include "texmap/TextureMapperPlatformLayer.h" 56 #endif 52 57 53 58 using namespace WTF; … … 603 608 } 604 609 605 #if USE(ACCELERATED_COMPOSITING) 610 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) 611 612 class TextureMapperVideoLayerQt : public virtual TextureMapperVideoLayer { 613 public: 614 TextureMapperVideoLayerQt(QGraphicsVideoItem* videoItem) 615 : m_videoItem(videoItem) 616 { 617 } 618 619 virtual void setPlatformLayerClient(TextureMapperLayerClient* client) 620 { 621 m_client = client; 622 } 623 624 virtual void paint(GraphicsContext* context) 625 { 626 if (!m_videoItem) 627 return; 628 629 QStyleOptionGraphicsItem opt; 630 opt.exposedRect = m_videoItem.data()->sceneBoundingRect(); 631 opt.rect = opt.exposedRect.toRect(); 632 m_videoItem.data()->paint(context->platformContext(), &opt); 633 } 634 635 virtual IntSize size() const 636 { 637 return m_videoItem ? IntSize(m_videoItem.data()->size().width(), m_videoItem.data()->size().height()) : IntSize(); 638 } 639 640 QWeakPointer<QGraphicsVideoItem> m_videoItem; 641 TextureMapperLayerClient* m_client; 642 }; 643 644 606 645 void MediaPlayerPrivateQt::acceleratedRenderingStateChanged() 607 646 { … … 613 652 m_composited = composited; 614 653 if (composited) 615 m_videoScene->removeItem(m_videoItem); 616 else 617 m_videoScene->addItem(m_videoItem); 654 m_platformLayer = new TextureMapperVideoLayerQt(m_videoItem); 618 655 } 619 656 620 657 PlatformLayer* MediaPlayerPrivateQt::platformLayer() const 621 658 { 622 return m_composited ? m_ videoItem: 0;659 return m_composited ? m_platformLayer.get() : 0; 623 660 } 624 661 #endif -
trunk/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
r68777 r69772 33 33 34 34 namespace WebCore { 35 36 class TextureMapperVideoLayer; 35 37 36 38 class MediaPlayerPrivateQt : public QObject, public MediaPlayerPrivateInterface { … … 92 94 93 95 #if USE(ACCELERATED_COMPOSITING) 96 #if USE(TEXTURE_MAPPER) 94 97 // whether accelerated rendering is supported by the media engine for the current media. 95 98 virtual bool supportsAcceleratedRendering() const { return true; } … … 98 101 // returns an object that can be directly composited via GraphicsLayerQt (essentially a QGraphicsItem*) 99 102 virtual PlatformLayer* platformLayer() const; 103 #else 104 virtual bool supportsAcceleratedRendering() const { return false; } 105 virtual void acceleratedRenderingStateChanged() { } 106 virtual PlatformLayer* platformLayer() const { return 0; } 107 #endif 100 108 #endif 101 109 … … 126 134 QGraphicsVideoItem* m_videoItem; 127 135 QGraphicsScene* m_videoScene; 136 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) 137 OwnPtr<TextureMapperVideoLayer> m_platformLayer; 138 #endif 128 139 129 140 mutable MediaPlayer::NetworkState m_networkState;
Note: See TracChangeset
for help on using the changeset viewer.