https://bugs.webkit.org/show_bug.cgi?id=83963
Reviewed by Adrienne Walker.
Source/Platform:
Adds a compositor layer type for video, WebVideoLayer, and a WebVideoProvider interface.
* Platform.gypi:
* chromium/public/WebContentLayer.h:
(WebContentLayer):
* chromium/public/WebLayer.h:
(WebLayer):
(WebKit::WebLayer::unwrap):
* chromium/public/WebVideoFrameProvider.h: Renamed from Source/WebCore/platform/graphics/chromium/VideoFrameProvider.h.
(WebKit):
(WebVideoFrameProvider):
(WebKit::WebVideoFrameProvider::~WebVideoFrameProvider):
(Client):
* chromium/public/WebVideoLayer.h: Copied from Source/WebKit/chromium/src/WebContentLayer.cpp.
(WebCore):
(WebKit):
(WebVideoLayer):
(WebKit::WebVideoLayer::WebVideoLayer):
(WebKit::WebVideoLayer::~WebVideoLayer):
Source/WebCore:
Converts VideoLayerChromium / CCVideoLayerImpl to use a Platform WebVideoFrameProvider interface instead of a
WebCore VideoFrameProvider.
* WebCore.gypi:
* platform/graphics/chromium/VideoLayerChromium.cpp:
(WebCore::VideoLayerChromium::create):
(WebCore::VideoLayerChromium::VideoLayerChromium):
* platform/graphics/chromium/VideoLayerChromium.h:
(WebKit):
(WebCore):
(VideoLayerChromium):
* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::CCVideoLayerImpl):
* platform/graphics/chromium/cc/CCVideoLayerImpl.h:
(WebCore::CCVideoLayerImpl::create):
(CCVideoLayerImpl):
Source/WebKit/chromium:
Adds implementation of WebVideoLayer and ports WebMediaPlayerClientImpl over to using it.
WebMediaPlayerClientImpl still exposes a WebCore::VideoLayerChromium* to the compositor via the platformLayer()
interface, but this is temporary until we can change the PlatformLayer typedef over to WebLayer.
* WebKit.gyp:
* src/WebContentLayer.cpp:
* src/WebLayer.cpp:
(WebKit::WebLayer::invalidate):
(WebKit):
* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::readyStateChanged):
(WebKit::WebMediaPlayerClientImpl::repaint):
(WebKit::WebMediaPlayerClientImpl::setOpaque):
(WebKit::WebMediaPlayerClientImpl::platformLayer):
(WebKit::WebMediaPlayerClientImpl::acceleratedRenderingInUse):
(WebKit::WebMediaPlayerClientImpl::setVideoFrameProviderClient):
(WebKit::WebMediaPlayerClientImpl::supportsType):
* src/WebMediaPlayerClientImpl.h:
(WebMediaPlayerClientImpl):
* src/WebVideoLayer.cpp: Copied from Source/WebKit/chromium/src/WebContentLayer.cpp.
(WebKit):
(WebKit::WebVideoLayer::create):
(WebKit::WebVideoLayer::WebVideoLayer):
(WebKit::WebVideoLayer::active):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114335
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-13 James Robinson <jamesr@chromium.org>
+
+ [chromium] Expose WebVideoLayer to Platform API and port WebMediaPlayerClientImpl to using it
+ https://bugs.webkit.org/show_bug.cgi?id=83963
+
+ Reviewed by Adrienne Walker.
+
+ Adds a compositor layer type for video, WebVideoLayer, and a WebVideoProvider interface.
+
+ * Platform.gypi:
+ * chromium/public/WebContentLayer.h:
+ (WebContentLayer):
+ * chromium/public/WebLayer.h:
+ (WebLayer):
+ (WebKit::WebLayer::unwrap):
+ * chromium/public/WebVideoFrameProvider.h: Renamed from Source/WebCore/platform/graphics/chromium/VideoFrameProvider.h.
+ (WebKit):
+ (WebVideoFrameProvider):
+ (WebKit::WebVideoFrameProvider::~WebVideoFrameProvider):
+ (Client):
+ * chromium/public/WebVideoLayer.h: Copied from Source/WebKit/chromium/src/WebContentLayer.cpp.
+ (WebCore):
+ (WebKit):
+ (WebVideoLayer):
+ (WebKit::WebVideoLayer::WebVideoLayer):
+ (WebKit::WebVideoLayer::~WebVideoLayer):
+
2012-04-11 James Robinson <jamesr@chromium.org>
[chromium] Remove unused compositeToTexture / compositeOffscreen setting
'chromium/public/WebURLRequest.h',
'chromium/public/WebURLResponse.h',
'chromium/public/WebVector.h',
+ 'chromium/public/WebVideoFrame.h',
+ 'chromium/public/WebVideoFrameProvider.h',
'chromium/src/Platform.cpp',
'chromium/src/WebCString.cpp',
'chromium/src/WebFloatQuad.cpp',
// WebContentLayerClient::paintContents before the compositing pass occurs.
WEBKIT_EXPORT void invalidateRect(const WebFloatRect&);
- // Sets the entire layer as invalid, i.e. needs to update its content.
- WEBKIT_EXPORT void invalidate();
-
#if WEBKIT_IMPLEMENTATION
WebContentLayer(const WTF::PassRefPtr<WebContentLayerImpl>&);
WebContentLayer& operator=(const WTF::PassRefPtr<WebContentLayerImpl>&);
WEBKIT_EXPORT void assign(const WebLayer&);
WEBKIT_EXPORT bool equals(const WebLayer&) const;
+ // Sets the entire layer as invalid, i.e. needs to update its content.
+ WEBKIT_EXPORT void invalidate();
+
WEBKIT_EXPORT WebLayer rootLayer() const;
WEBKIT_EXPORT WebLayer parent() const;
WEBKIT_EXPORT void addChild(const WebLayer&);
WebLayer(const WTF::PassRefPtr<WebCore::LayerChromium>&);
WebLayer& operator=(const WTF::PassRefPtr<WebCore::LayerChromium>&);
operator WTF::PassRefPtr<WebCore::LayerChromium>() const;
- template<typename T> T* unwrap()
+ template<typename T> T* unwrap() const
{
return static_cast<T*>(m_private.get());
}
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef VideoFrameProvider_h
-#define VideoFrameProvider_h
+#ifndef WebVideoFrameProvider_h
+#define WebVideoFrameProvider_h
-#include <public/WebVideoFrame.h>
+#include "WebCommon.h"
+#include "WebVideoFrame.h"
-namespace WebCore {
+namespace WebKit {
-class VideoFrameProvider {
+// Threading notes: This class may be used in a multi threaded manner. Specifically, the implementation
+// may call getCurrentFrame() / putCurrentFrame() from a non-main thread. If so, the caller is responsible
+// for making sure Client::didReceiveFrame and Client::didUpdateMatrix are only called from this thread.
+class WebVideoFrameProvider {
public:
- virtual ~VideoFrameProvider() { }
+ virtual ~WebVideoFrameProvider() { }
class Client {
public:
// Provider will call this method to tell the client to stop using it.
+ // stopUsingProvider() may be called from any thread.
virtual void stopUsingProvider() = 0;
+
+ // Notifies the provider's client that a call to getCurrentFrame() will return new data.
virtual void didReceiveFrame() = 0;
+
+ // Notifies the provider's client of a new UV transform matrix to be used when drawing frames
+ // of type WebVideoFrame::FormatStreamTexture.
virtual void didUpdateMatrix(const float*) = 0;
};
+ // May be called from any thread.
virtual void setVideoFrameProviderClient(Client*) = 0;
// This function places a lock on the current frame and returns a pointer to it.
// Calls to this method should always be followed with a call to putCurrentFrame().
// The ownership of the object is not transferred to the caller and
// the caller should not free the returned object.
- virtual WebKit::WebVideoFrame* getCurrentFrame() = 0;
+ virtual WebVideoFrame* getCurrentFrame() = 0;
// This function releases the lock on the video frame in chromium. It should
// always be called after getCurrentFrame(). Frames passed into this method
// should no longer be referenced after the call is made.
- virtual void putCurrentFrame(WebKit::WebVideoFrame*) = 0;
+ virtual void putCurrentFrame(WebVideoFrame*) = 0;
};
-} // namespace WebCore
+} // namespace WebKit
#endif
--- /dev/null
+/*
+ * Copyright (C) 2011 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:
+ *
+ * 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 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 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.
+ */
+
+#ifndef WebVideoLayer_h
+#define WebVideoLayer_h
+
+#include "WebCommon.h"
+#include "WebLayer.h"
+
+namespace WebCore {
+class VideoLayerChromium;
+}
+
+namespace WebKit {
+
+class WebVideoFrameProvider;
+
+class WebVideoLayer : public WebLayer {
+public:
+ WEBKIT_EXPORT static WebVideoLayer create(WebVideoFrameProvider*);
+
+ WebVideoLayer() { }
+ virtual ~WebVideoLayer() { }
+
+ // Returns true if this layer is actively rendering (e.g. currently attached to a WebLayerTreeView).
+ WEBKIT_EXPORT bool active() const;
+
+#if WEBKIT_IMPLEMENTATION
+ explicit WebVideoLayer(PassRefPtr<WebCore::VideoLayerChromium>);
+#endif
+};
+
+} // namespace WebKit
+
+#endif // WebVideoLayer_h
+2012-04-13 James Robinson <jamesr@chromium.org>
+
+ [chromium] Expose WebVideoLayer to Platform API and port WebMediaPlayerClientImpl to using it
+ https://bugs.webkit.org/show_bug.cgi?id=83963
+
+ Reviewed by Adrienne Walker.
+
+ Converts VideoLayerChromium / CCVideoLayerImpl to use a Platform WebVideoFrameProvider interface instead of a
+ WebCore VideoFrameProvider.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+ (WebCore::VideoLayerChromium::create):
+ (WebCore::VideoLayerChromium::VideoLayerChromium):
+ * platform/graphics/chromium/VideoLayerChromium.h:
+ (WebKit):
+ (WebCore):
+ (VideoLayerChromium):
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
+ (WebCore::CCVideoLayerImpl::CCVideoLayerImpl):
+ * platform/graphics/chromium/cc/CCVideoLayerImpl.h:
+ (WebCore::CCVideoLayerImpl::create):
+ (CCVideoLayerImpl):
+
2012-04-16 Takashi Sakamoto <tasak@google.com>
[Shadow DOM] InsertionPoint should have isActive() member function.
'platform/graphics/chromium/UniscribeHelperTextRun.h',
'platform/graphics/chromium/VDMXParser.cpp',
'platform/graphics/chromium/VDMXParser.h',
- 'platform/graphics/chromium/VideoFrameProvider.h',
'platform/graphics/chromium/VideoLayerChromium.cpp',
'platform/graphics/chromium/VideoLayerChromium.h',
'platform/graphics/chromium/WebGLLayerChromium.cpp',
namespace WebCore {
-PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(VideoFrameProvider* provider)
+PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(WebKit::WebVideoFrameProvider* provider)
{
return adoptRef(new VideoLayerChromium(provider));
}
-VideoLayerChromium::VideoLayerChromium(VideoFrameProvider* provider)
+VideoLayerChromium::VideoLayerChromium(WebKit::WebVideoFrameProvider* provider)
: LayerChromium()
, m_provider(provider)
{
#include "LayerChromium.h"
+namespace WebKit {
+class WebVideoFrameProvider;
+}
+
namespace WebCore {
class CCVideoLayerImpl;
-class VideoFrameProvider;
// A Layer that contains a Video element.
class VideoLayerChromium : public LayerChromium {
public:
- static PassRefPtr<VideoLayerChromium> create(VideoFrameProvider* = 0);
+ static PassRefPtr<VideoLayerChromium> create(WebKit::WebVideoFrameProvider*);
virtual ~VideoLayerChromium();
virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() OVERRIDE;
private:
- explicit VideoLayerChromium(VideoFrameProvider*);
+ explicit VideoLayerChromium(WebKit::WebVideoFrameProvider*);
// This pointer is only for passing to CCVideoLayerImpl's constructor. It should never be dereferenced by this class.
- VideoFrameProvider* m_provider;
+ WebKit::WebVideoFrameProvider* m_provider;
};
}
0, 1, 0, 1,
};
-CCVideoLayerImpl::CCVideoLayerImpl(int id, VideoFrameProvider* provider)
+CCVideoLayerImpl::CCVideoLayerImpl(int id, WebKit::WebVideoFrameProvider* provider)
: CCLayerImpl(id)
, m_provider(provider)
, m_layerTreeHostImpl(0)
#include "ManagedTexture.h"
#include "ShaderChromium.h"
-#include "VideoFrameProvider.h"
#include "VideoLayerChromium.h"
#include "cc/CCLayerImpl.h"
+#include <public/WebVideoFrameProvider.h>
namespace WebKit {
class WebVideoFrame;
template<class VertexShader, class FragmentShader> class ProgramBinding;
class CCVideoLayerImpl : public CCLayerImpl
- , public VideoFrameProvider::Client {
+ , public WebKit::WebVideoFrameProvider::Client {
public:
- static PassOwnPtr<CCVideoLayerImpl> create(int id, VideoFrameProvider* provider)
+ static PassOwnPtr<CCVideoLayerImpl> create(int id, WebKit::WebVideoFrameProvider* provider)
{
return adoptPtr(new CCVideoLayerImpl(id, provider));
}
virtual void dumpLayerProperties(TextStream&, int indent) const OVERRIDE;
Mutex& providerMutex() { return m_providerMutex; }
- VideoFrameProvider* provider() const { return m_provider; }
- // VideoFrameProvider::Client implementation.
+ // WebKit::WebVideoFrameProvider::Client implementation.
virtual void stopUsingProvider(); // Callable on any thread.
virtual void didReceiveFrame(); // Callable on impl thread.
virtual void didUpdateMatrix(const float*); // Callable on impl thread.
enum { MaxPlanes = 3 };
private:
- explicit CCVideoLayerImpl(int, VideoFrameProvider*);
+ CCVideoLayerImpl(int, WebKit::WebVideoFrameProvider*);
static IntSize computeVisibleSize(const WebKit::WebVideoFrame&, unsigned plane);
virtual const char* layerTypeAsString() const OVERRIDE { return "VideoLayer"; }
bool reserveTextures(const WebKit::WebVideoFrame&, GC3Denum format, LayerRendererChromium*);
Mutex m_providerMutex; // Guards m_provider below.
- VideoFrameProvider* m_provider;
+ WebKit::WebVideoFrameProvider* m_provider;
Texture m_textures[MaxPlanes];
+2012-04-13 James Robinson <jamesr@chromium.org>
+
+ [chromium] Expose WebVideoLayer to Platform API and port WebMediaPlayerClientImpl to using it
+ https://bugs.webkit.org/show_bug.cgi?id=83963
+
+ Reviewed by Adrienne Walker.
+
+ Adds implementation of WebVideoLayer and ports WebMediaPlayerClientImpl over to using it.
+ WebMediaPlayerClientImpl still exposes a WebCore::VideoLayerChromium* to the compositor via the platformLayer()
+ interface, but this is temporary until we can change the PlatformLayer typedef over to WebLayer.
+
+ * WebKit.gyp:
+ * src/WebContentLayer.cpp:
+ * src/WebLayer.cpp:
+ (WebKit::WebLayer::invalidate):
+ (WebKit):
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::readyStateChanged):
+ (WebKit::WebMediaPlayerClientImpl::repaint):
+ (WebKit::WebMediaPlayerClientImpl::setOpaque):
+ (WebKit::WebMediaPlayerClientImpl::platformLayer):
+ (WebKit::WebMediaPlayerClientImpl::acceleratedRenderingInUse):
+ (WebKit::WebMediaPlayerClientImpl::setVideoFrameProviderClient):
+ (WebKit::WebMediaPlayerClientImpl::supportsType):
+ * src/WebMediaPlayerClientImpl.h:
+ (WebMediaPlayerClientImpl):
+ * src/WebVideoLayer.cpp: Copied from Source/WebKit/chromium/src/WebContentLayer.cpp.
+ (WebKit):
+ (WebKit::WebVideoLayer::create):
+ (WebKit::WebVideoLayer::WebVideoLayer):
+ (WebKit::WebVideoLayer::active):
+
2012-04-16 Aaron Colwell <acolwell@chromium.org>
Fix WebKit style violations in Chromium WebMediaPlayer.h & WebMediaPlayerClient.h
'src/WebURLLoadTiming.cpp',
'src/WebScopedUserGesture.cpp',
'src/WebUserMediaRequest.cpp',
+ 'src/WebVideoLayer.cpp',
'src/WebViewImpl.cpp',
'src/WebViewImpl.h',
'src/WebWorkerBase.cpp',
unwrap<WebContentLayerImpl>()->setNeedsDisplayRect(dirtyRect);
}
-void WebContentLayer::invalidate()
-{
- unwrap<WebContentLayerImpl>()->setNeedsDisplay();
-}
-
WebContentLayer::WebContentLayer(const PassRefPtr<WebContentLayerImpl>& node)
: WebLayer(node)
{
return (m_private.get() == n.m_private.get());
}
+void WebLayer::invalidate()
+{
+ m_private->setNeedsDisplay();
+}
+
WebLayer WebLayer::rootLayer() const
{
return WebLayer(const_cast<LayerChromium*>(m_private->rootLayer()));
ASSERT(m_mediaPlayer);
m_mediaPlayer->readyStateChanged();
#if USE(ACCELERATED_COMPOSITING)
- if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer) {
- m_videoLayer = VideoLayerChromium::create(this);
- m_videoLayer->setOpaque(m_opaque);
+ if (hasVideo() && supportsAcceleratedRendering() && m_videoLayer.isNull()) {
+ m_videoLayer = WebVideoLayer::create(this);
+ m_videoLayer.setOpaque(m_opaque);
}
#endif
}
{
ASSERT(m_mediaPlayer);
#if USE(ACCELERATED_COMPOSITING)
- if (m_videoLayer && supportsAcceleratedRendering())
- m_videoLayer->setNeedsDisplay();
+ if (!m_videoLayer.isNull() && supportsAcceleratedRendering())
+ m_videoLayer.invalidate();
#endif
m_mediaPlayer->repaint();
}
{
#if USE(ACCELERATED_COMPOSITING)
m_opaque = opaque;
- if (m_videoLayer)
- m_videoLayer->setOpaque(m_opaque);
+ if (!m_videoLayer.isNull())
+ m_videoLayer.setOpaque(m_opaque);
#endif
}
PlatformLayer* WebMediaPlayerClientImpl::platformLayer() const
{
ASSERT(m_supportsAcceleratedCompositing);
- return m_videoLayer.get();
+ return m_videoLayer.unwrap<VideoLayerChromium>();
}
#endif
bool WebMediaPlayerClientImpl::acceleratedRenderingInUse()
{
- return m_videoLayer && m_videoLayer->layerTreeHost();
+ return !m_videoLayer.isNull() && m_videoLayer.active();
}
-void WebMediaPlayerClientImpl::setVideoFrameProviderClient(VideoFrameProvider::Client* client)
+void WebMediaPlayerClientImpl::setVideoFrameProviderClient(WebVideoFrameProvider::Client* client)
{
MutexLocker locker(m_compositingMutex);
m_videoFrameProviderClient = client;
, m_delayingLoad(false)
, m_preload(MediaPlayer::MetaData)
#if USE(ACCELERATED_COMPOSITING)
- , m_videoLayer(0)
, m_supportsAcceleratedCompositing(false)
, m_opaque(false)
, m_videoFrameProviderClient(0)
#include "AudioSourceProvider.h"
#include "MediaPlayerPrivate.h"
-#include "VideoFrameProvider.h"
-#include "VideoLayerChromium.h"
#include "WebAudioSourceProviderClient.h"
#include "WebMediaPlayerClient.h"
#include "WebStreamTextureClient.h"
+#include <public/WebVideoFrameProvider.h>
+#include <public/WebVideoLayer.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
// WebKit::WebMediaPlayer.
class WebMediaPlayerClientImpl : public WebCore::MediaPlayerPrivateInterface
#if USE(ACCELERATED_COMPOSITING)
- , public WebCore::VideoFrameProvider
+ , public WebVideoFrameProvider
#endif
, public WebMediaPlayerClient
, public WebStreamTextureClient {
#if USE(ACCELERATED_COMPOSITING)
virtual bool supportsAcceleratedRendering() const;
- // VideoFrameProvider methods:
- virtual void setVideoFrameProviderClient(VideoFrameProvider::Client*);
+ // WebVideoFrameProvider methods:
+ virtual void setVideoFrameProviderClient(WebVideoFrameProvider::Client*);
virtual WebVideoFrame* getCurrentFrame();
virtual void putCurrentFrame(WebVideoFrame*);
#endif
bool m_delayingLoad;
WebCore::MediaPlayer::Preload m_preload;
#if USE(ACCELERATED_COMPOSITING)
- RefPtr<WebCore::VideoLayerChromium> m_videoLayer;
+ WebVideoLayer m_videoLayer;
bool m_supportsAcceleratedCompositing;
bool m_opaque;
- VideoFrameProvider::Client* m_videoFrameProviderClient;
+ WebVideoFrameProvider::Client* m_videoFrameProviderClient;
#endif
static bool m_isEnabled;
--- /dev/null
+/*
+ * Copyright (C) 2011 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:
+ *
+ * 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 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 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.
+ */
+
+#include "config.h"
+#include "VideoLayerChromium.h"
+#include <public/WebVideoLayer.h>
+
+namespace WebKit {
+
+WebVideoLayer WebVideoLayer::create(WebVideoFrameProvider* provider)
+{
+ return WebVideoLayer(WebCore::VideoLayerChromium::create(provider));
+}
+
+WebVideoLayer::WebVideoLayer(PassRefPtr<WebCore::VideoLayerChromium> layer)
+ : WebLayer(layer)
+{
+}
+
+bool WebVideoLayer::active() const
+{
+ return m_private->layerTreeHost();
+}
+
+} // namespace WebKit