summaryrefslogtreecommitdiffstats
path: root/webkit/compositor_bindings/web_external_texture_layer_impl.h
blob: a991a1982bd05b4aaf60ab9c9f40366d8d6dd51d (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
38
39
40
41
42
43
44
45
// 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.

#ifndef WebExternalTextureLayerImpl_h
#define WebExternalTextureLayerImpl_h

#include "base/memory/scoped_ptr.h"
#include "cc/texture_layer_client.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureLayer.h"
#include "webkit/compositor_bindings/webkit_compositor_bindings_export.h"

namespace WebKit {

class WebLayerImpl;

class WebExternalTextureLayerImpl : public WebExternalTextureLayer,
                                    public cc::TextureLayerClient {
public:
    WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebExternalTextureLayerImpl(
        WebExternalTextureLayerClient*);
    virtual ~WebExternalTextureLayerImpl();

    // WebExternalTextureLayer implementation.
    virtual WebLayer* layer() OVERRIDE;
    virtual void setTextureId(unsigned) OVERRIDE;
    virtual void setFlipped(bool) OVERRIDE;
    virtual void setUVRect(const WebFloatRect&) OVERRIDE;
    virtual void setOpaque(bool) OVERRIDE;
    virtual void setPremultipliedAlpha(bool) OVERRIDE;
    virtual void willModifyTexture() OVERRIDE;
    virtual void setRateLimitContext(bool) OVERRIDE;

    // TextureLayerClient implementation.
    virtual unsigned prepareTexture(cc::ResourceUpdateQueue&) OVERRIDE;
    virtual WebGraphicsContext3D* context() OVERRIDE;

private:
    WebExternalTextureLayerClient* m_client;
    scoped_ptr<WebLayerImpl> m_layer;
};

}

#endif // WebExternalTextureLayerImpl_h