summaryrefslogtreecommitdiffstats
path: root/cc/shared_quad_state.cc
blob: 0d017c4f05fc92262ab9a873e2908a02241dabba (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
// 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.

#include "config.h"

#include "cc/shared_quad_state.h"

namespace cc {

scoped_ptr<CCSharedQuadState> CCSharedQuadState::create(const WebKit::WebTransformationMatrix& quadTransform, const gfx::Rect& visibleContentRect, const gfx::Rect& clippedRectInTarget, float opacity, bool opaque)
{
    return make_scoped_ptr(new CCSharedQuadState(quadTransform, visibleContentRect, clippedRectInTarget, opacity, opaque));
}

CCSharedQuadState::CCSharedQuadState(const WebKit::WebTransformationMatrix& quadTransform, const gfx::Rect& visibleContentRect, const gfx::Rect& clippedRectInTarget, float opacity, bool opaque)
    : id(-1)
    , quadTransform(quadTransform)
    , visibleContentRect(visibleContentRect)
    , clippedRectInTarget(clippedRectInTarget)
    , opacity(opacity)
    , opaque(opaque)
{
}

scoped_ptr<CCSharedQuadState> CCSharedQuadState::copy() const
{
    scoped_ptr<CCSharedQuadState> copiedState(create(quadTransform, visibleContentRect, clippedRectInTarget, opacity, opaque));
    copiedState->id = id;
    return copiedState.Pass();
}

}  // namespace cc