summaryrefslogtreecommitdiffstats
path: root/cc/CCRenderPassDrawQuad.h
blob: 99222d9edb83c4bcedca424f85fe43ad40f4a275 (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
46
47
48
49
50
51
// 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 CCRenderPassDrawQuad_h
#define CCRenderPassDrawQuad_h

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "CCDrawQuad.h"
#include "CCRenderPass.h"
#include "CCResourceProvider.h"
#include "IntRect.h"

namespace cc {

class CCRenderPassDrawQuad : public CCDrawQuad {
public:
    static scoped_ptr<CCRenderPassDrawQuad> create(const CCSharedQuadState*, const IntRect&, CCRenderPass::Id renderPassId, bool isReplica, CCResourceProvider::ResourceId maskResourceId, const IntRect& contentsChangedSinceLastFrame, float maskTexCoordScaleX, float maskTexCoordScaleY, float maskTexCoordOffsetX, float maskTexCoordOffsetY);

    CCRenderPass::Id renderPassId() const { return m_renderPassId; }
    bool isReplica() const { return m_isReplica; }
    CCResourceProvider::ResourceId maskResourceId() const { return m_maskResourceId; }
    const IntRect& contentsChangedSinceLastFrame() const { return m_contentsChangedSinceLastFrame; }

    static const CCRenderPassDrawQuad* materialCast(const CCDrawQuad*);
    float maskTexCoordScaleX() const { return m_maskTexCoordScaleX; }
    float maskTexCoordScaleY() const { return m_maskTexCoordScaleY; }
    float maskTexCoordOffsetX() const { return m_maskTexCoordOffsetX; }
    float maskTexCoordOffsetY() const { return m_maskTexCoordOffsetY; }

    scoped_ptr<CCRenderPassDrawQuad> copy(const CCSharedQuadState* copiedSharedQuadState, CCRenderPass::Id copiedRenderPassId) const;

private:
    CCRenderPassDrawQuad(const CCSharedQuadState*, const IntRect&, CCRenderPass::Id renderPassId, bool isReplica, CCResourceProvider::ResourceId maskResourceId, const IntRect& contentsChangedSinceLastFrame, float maskTexCoordScaleX, float maskTexCoordScaleY, float maskTexCoordOffsetX, float maskTexCoordOffsetY);

    CCRenderPass::Id m_renderPassId;
    bool m_isReplica;
    CCResourceProvider::ResourceId m_maskResourceId;
    IntRect m_contentsChangedSinceLastFrame;
    float m_maskTexCoordScaleX;
    float m_maskTexCoordScaleY;
    float m_maskTexCoordOffsetX;
    float m_maskTexCoordOffsetY;

    DISALLOW_COPY_AND_ASSIGN(CCRenderPassDrawQuad);
};

}

#endif