summaryrefslogtreecommitdiffstats
path: root/cc/checkerboard_draw_quad.cc
blob: 69564949041376d6dd6360669f938e6a476a87ed (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
// 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/checkerboard_draw_quad.h"

#include "base/logging.h"

namespace cc {

scoped_ptr<CheckerboardDrawQuad> CheckerboardDrawQuad::create(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, SkColor color)
{
    return make_scoped_ptr(new CheckerboardDrawQuad(sharedQuadState, quadRect, color));
}

CheckerboardDrawQuad::CheckerboardDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, SkColor color)
    : DrawQuad(sharedQuadState, DrawQuad::Checkerboard, quadRect)
    , m_color(color)
{
}

const CheckerboardDrawQuad* CheckerboardDrawQuad::materialCast(const DrawQuad* quad)
{
    DCHECK(quad->material() == DrawQuad::Checkerboard);
    return static_cast<const CheckerboardDrawQuad*>(quad);
}

}  // namespace cc