summaryrefslogtreecommitdiffstats
path: root/webkit/compositor_bindings/WebVideoLayerImpl.cpp
blob: 7241706801f6b5e1f5bc944313d30fa9441d1081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "config.h"
#include "WebVideoLayerImpl.h"

#include "VideoLayerChromium.h"
#include "WebLayerImpl.h"

namespace WebKit {

WebVideoLayer* WebVideoLayer::create(WebVideoFrameProvider* provider)
{
    return new WebVideoLayerImpl(provider);
}

WebVideoLayerImpl::WebVideoLayerImpl(WebVideoFrameProvider* provider)
    : m_layer(adoptPtr(new WebLayerImpl(cc::VideoLayerChromium::create(provider))))
{
}

WebVideoLayerImpl::~WebVideoLayerImpl()
{
}

WebLayer* WebVideoLayerImpl::layer()
{
    return m_layer.get();
}

bool WebVideoLayerImpl::active() const
{
    return m_layer->layer()->layerTreeHost();
}

} // namespace WebKit