[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:20:52 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 24b102d9ed3db6250c54cfb557d522e86e45a370
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jul 20 06:28:51 2010 +0000
2010-07-19 Victoria Kirst <vrk at google.com>
Reviewed by David Levin.
Added a simple implementation of VideoLayerChromium. Uses the
LayerChromium::updateTextureRect() to send video frames to the
GPU.
https://bugs.webkit.org/show_bug.cgi?id=42234
* WebCore.gypi: Added include for VideoLayerChromium.
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setContentsToMedia): Implemented
setContentsToMedia, though it does not seem to trigger a repaint
correctly.
* platform/graphics/chromium/GraphicsLayerChromium.h:
* platform/graphics/chromium/VideoLayerChromium.cpp: Added.
(WebCore::VideoLayerChromium::create):
(WebCore::VideoLayerChromium::VideoLayerChromium):
(WebCore::VideoLayerChromium::updateTextureContents):
* platform/graphics/chromium/VideoLayerChromium.h: Added.
(WebCore::VideoLayerChromium::drawsContent):
2010-07-19 Victoria Kirst <vrk at google.com>
Reviewed by David Levin.
Updated WebMediaPlayer to support accelerated rendering and to
create and return a VideoChromiumLayer as its platform layer.
https://bugs.webkit.org/show_bug.cgi?id=42234
* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::platformLayer):
(WebKit::WebMediaPlayerClientImpl::create):
* src/WebMediaPlayerClientImpl.h:
(WebKit::WebMediaPlayerClientImpl::supportsAcceleratedRendering):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d20857e..34aeeb6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-07-19 Victoria Kirst <vrk at google.com>
+
+ Reviewed by David Levin.
+
+ Added a simple implementation of VideoLayerChromium. Uses the
+ LayerChromium::updateTextureRect() to send video frames to the
+ GPU.
+ https://bugs.webkit.org/show_bug.cgi?id=42234
+
+ * WebCore.gypi: Added include for VideoLayerChromium.
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::setContentsToMedia): Implemented
+ setContentsToMedia, though it does not seem to trigger a repaint
+ correctly.
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ * platform/graphics/chromium/VideoLayerChromium.cpp: Added.
+ (WebCore::VideoLayerChromium::create):
+ (WebCore::VideoLayerChromium::VideoLayerChromium):
+ (WebCore::VideoLayerChromium::updateTextureContents):
+ * platform/graphics/chromium/VideoLayerChromium.h: Added.
+ (WebCore::VideoLayerChromium::drawsContent):
+
2010-07-19 Dirk Schulze <krit at webkit.org>
Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index d2d3f55..7aa5d60 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -2210,6 +2210,8 @@
'platform/graphics/chromium/UniscribeHelper.h',
'platform/graphics/chromium/UniscribeHelperTextRun.cpp',
'platform/graphics/chromium/UniscribeHelperTextRun.h',
+ 'platform/graphics/chromium/VideoLayerChromium.cpp',
+ 'platform/graphics/chromium/VideoLayerChromium.h',
'platform/graphics/chromium/WebGLLayerChromium.cpp',
'platform/graphics/chromium/WebGLLayerChromium.h',
'platform/graphics/filters/FEBlend.cpp',
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
index 9b65346..a01a17f 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -363,9 +363,30 @@ void GraphicsLayerChromium::setContentsToWebGL(PlatformLayer* platformLayer)
}
#endif
-void GraphicsLayerChromium::setContentsToVideo(PlatformLayer* videoLayer)
+void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
{
- // FIXME: Implement
+ bool childrenChanged = false;
+ if (layer) {
+ if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForVideo) {
+ setupContentsLayer(layer);
+ m_contentsLayer = layer;
+ m_contentsLayerPurpose = ContentsLayerForVideo;
+ childrenChanged = true;
+ }
+ layer->setOwner(this);
+ layer->setNeedsDisplay();
+ updateContentsRect();
+ } else {
+ if (m_contentsLayer) {
+ childrenChanged = true;
+
+ // The old contents layer will be removed via updateSublayerList.
+ m_contentsLayer = 0;
+ }
+ }
+
+ if (childrenChanged)
+ updateSublayerList();
}
void GraphicsLayerChromium::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
index ccd02eb..cd5e479 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -85,7 +85,7 @@ public:
virtual void setContentsRect(const IntRect&);
virtual void setContentsToImage(Image*);
- virtual void setContentsToVideo(PlatformLayer*);
+ virtual void setContentsToMedia(PlatformLayer*);
virtual void setContentsToWebGL(PlatformLayer*);
virtual PlatformLayer* platformLayer() const;
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
new file mode 100644
index 0000000..5ac0e57
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "VideoLayerChromium.h"
+
+namespace WebCore {
+
+PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(GraphicsLayerChromium* owner)
+{
+ return adoptRef(new VideoLayerChromium(owner));
+}
+
+VideoLayerChromium::VideoLayerChromium(GraphicsLayerChromium* owner)
+ : LayerChromium(owner)
+{
+}
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.h b/WebCore/platform/graphics/chromium/VideoLayerChromium.h
new file mode 100644
index 0000000..1fa8009
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+
+#ifndef VideoLayerChromium_h
+#define VideoLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+namespace WebCore {
+
+// A Layer that contains a Video element.
+class VideoLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<VideoLayerChromium> create(GraphicsLayerChromium* owner = 0);
+ virtual bool drawsContent() { return true; }
+
+private:
+ VideoLayerChromium(GraphicsLayerChromium* owner);
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 5039925..8a87a64 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-19 Victoria Kirst <vrk at google.com>
+
+ Reviewed by David Levin.
+
+ Updated WebMediaPlayer to support accelerated rendering and to
+ create and return a VideoChromiumLayer as its platform layer.
+ https://bugs.webkit.org/show_bug.cgi?id=42234
+
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::platformLayer):
+ (WebKit::WebMediaPlayerClientImpl::create):
+ * src/WebMediaPlayerClientImpl.h:
+ (WebKit::WebMediaPlayerClientImpl::supportsAcceleratedRendering):
+
2010-07-19 Kenneth Russell <kbr at google.com>
Reviewed by Nate Chapin.
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index 03051c3..de9cd14 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -14,7 +14,13 @@
#include "KURL.h"
#include "MediaPlayer.h"
#include "NotImplemented.h"
+#include "RenderView.h"
#include "TimeRanges.h"
+#include "VideoLayerChromium.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+#include "RenderLayerCompositor.h"
+#endif
#include "WebCanvas.h"
#include "WebCString.h"
@@ -28,6 +34,7 @@
#include "WebSize.h"
#include "WebString.h"
#include "WebURL.h"
+#include "WebViewImpl.h"
// WebCommon.h defines WEBKIT_USING_SKIA so this has to be included last.
#if WEBKIT_USING_SKIA
@@ -45,6 +52,7 @@ static WebMediaPlayer* createWebMediaPlayer(
WebMediaPlayerClient* client, Frame* frame)
{
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
+
if (!webFrame->client())
return 0;
return webFrame->client()->createMediaPlayer(webFrame, client);
@@ -146,6 +154,7 @@ void WebMediaPlayerClientImpl::load(const String& url)
{
Frame* frame = static_cast<HTMLMediaElement*>(
m_mediaPlayer->mediaPlayerClient())->document()->frame();
+
m_webMediaPlayer.set(createWebMediaPlayer(this, frame));
if (m_webMediaPlayer.get())
m_webMediaPlayer->load(KURL(ParsedURLString, url));
@@ -157,6 +166,14 @@ void WebMediaPlayerClientImpl::cancelLoad()
m_webMediaPlayer->cancelLoad();
}
+#if USE(ACCELERATED_COMPOSITING)
+WebCore::PlatformLayer* WebMediaPlayerClientImpl::platformLayer() const
+{
+ ASSERT(m_supportsAcceleratedCompositing);
+ return m_videoLayer.get();
+}
+#endif
+
void WebMediaPlayerClientImpl::play()
{
if (m_webMediaPlayer.get())
@@ -360,6 +377,13 @@ bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const
return false;
}
+#if USE(ACCELERATED_COMPOSITING)
+bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const
+{
+ return m_supportsAcceleratedCompositing;
+}
+#endif
+
MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const
{
if (m_webMediaPlayer.get())
@@ -372,6 +396,22 @@ MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* playe
{
WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl();
client->m_mediaPlayer = player;
+
+#if USE(ACCELERATED_COMPOSITING)
+ Frame* frame = static_cast<HTMLMediaElement*>(
+ client->m_mediaPlayer->mediaPlayerClient())->document()->frame();
+
+ // This does not actually check whether the hardware can support accelerated
+ // compositing, but only if the flag is set. However, this is checked lazily
+ // in WebViewImpl::setIsAcceleratedCompositingActive() and will fail there
+ // if necessary.
+ client->m_supportsAcceleratedCompositing =
+ frame->contentRenderer()->compositor()->hasAcceleratedCompositing();
+
+ if (client->m_supportsAcceleratedCompositing)
+ client->m_videoLayer = VideoLayerChromium::create(0);
+#endif
+
return client;
}
@@ -402,6 +442,10 @@ MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& t
WebMediaPlayerClientImpl::WebMediaPlayerClientImpl()
: m_mediaPlayer(0)
+#if USE(ACCELERATED_COMPOSITING)
+ , m_videoLayer(0)
+ , m_supportsAcceleratedCompositing(false)
+#endif
{
}
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h
index 57c93b7..ff03b5b 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h
@@ -66,6 +66,9 @@ public:
// MediaPlayerPrivateInterface methods:
virtual void load(const WebCore::String& url);
virtual void cancelLoad();
+#if USE(ACCELERATED_COMPOSITING)
+ virtual WebCore::PlatformLayer* platformLayer() const;
+#endif
virtual void play();
virtual void pause();
virtual bool supportsFullscreen() const;
@@ -94,6 +97,10 @@ public:
virtual void setSize(const WebCore::IntSize&);
virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&);
virtual bool hasSingleSecurityOrigin() const;
+#if USE(ACCELERATED_COMPOSITING)
+ virtual bool supportsAcceleratedRendering() const;
+#endif
+
virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const;
private:
@@ -106,6 +113,10 @@ private:
WebCore::MediaPlayer* m_mediaPlayer;
OwnPtr<WebMediaPlayer> m_webMediaPlayer;
+#if USE(ACCELERATED_COMPOSITING)
+ RefPtr<WebCore::PlatformLayer> m_videoLayer;
+ bool m_supportsAcceleratedCompositing;
+#endif
static bool m_isEnabled;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list