summaryrefslogtreecommitdiffstats
path: root/cc/io_surface_layer_impl.h
blob: aef12de22fc9af461504c88480e90aff4419cadf (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
// Copyright 2012 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 CCIOSurfaceLayerImpl_h
#define CCIOSurfaceLayerImpl_h

#include "IntSize.h"
#include "cc/layer_impl.h"

namespace cc {

class IOSurfaceLayerImpl : public LayerImpl {
public:
    static scoped_ptr<IOSurfaceLayerImpl> create(int id)
    {
        return make_scoped_ptr(new IOSurfaceLayerImpl(id));
    }
    virtual ~IOSurfaceLayerImpl();

    void setIOSurfaceProperties(unsigned ioSurfaceId, const IntSize&);

    virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE;

    virtual void willDraw(ResourceProvider*) OVERRIDE;
    virtual void didLoseContext() OVERRIDE;

    virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE;

private:
    explicit IOSurfaceLayerImpl(int);

    virtual const char* layerTypeAsString() const OVERRIDE;

    unsigned m_ioSurfaceId;
    IntSize m_ioSurfaceSize;
    bool m_ioSurfaceChanged;
    unsigned m_ioSurfaceTextureId;
};

}

#endif // CCIOSurfaceLayerImpl_h