summaryrefslogtreecommitdiffstats
path: root/cc/CCStreamVideoDrawQuad.cpp
blob: e92d98a390fe137e8b32ae271029f772ffc00236 (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
// 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 "CCStreamVideoDrawQuad.h"

namespace cc {

scoped_ptr<CCStreamVideoDrawQuad> CCStreamVideoDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, unsigned textureId, const WebKit::WebTransformationMatrix& matrix)
{
    return make_scoped_ptr(new CCStreamVideoDrawQuad(sharedQuadState, quadRect, textureId, matrix));
}

CCStreamVideoDrawQuad::CCStreamVideoDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, unsigned textureId, const WebKit::WebTransformationMatrix& matrix)
    : CCDrawQuad(sharedQuadState, CCDrawQuad::StreamVideoContent, quadRect)
    , m_textureId(textureId)
    , m_matrix(matrix)
{
}

const CCStreamVideoDrawQuad* CCStreamVideoDrawQuad::materialCast(const CCDrawQuad* quad)
{
    ASSERT(quad->material() == CCDrawQuad::StreamVideoContent);
    return static_cast<const CCStreamVideoDrawQuad*>(quad);
}

}  // namespace cc