summaryrefslogtreecommitdiffstats
path: root/cc/quads/shared_quad_state.cc
blob: 7bfb2b440f378b9333383add131a297eabb71fa3 (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
// 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 "cc/quads/shared_quad_state.h"

namespace cc {

SharedQuadState::SharedQuadState() : is_clipped(false), opacity(0.f) {}

SharedQuadState::~SharedQuadState() {}

scoped_ptr<SharedQuadState> SharedQuadState::Create() {
  return make_scoped_ptr(new SharedQuadState);
}

scoped_ptr<SharedQuadState> SharedQuadState::Copy() const {
  return make_scoped_ptr(new SharedQuadState(*this));
}

void SharedQuadState::SetAll(
    const gfx::Transform& content_to_target_transform,
    gfx::Size content_bounds,
    gfx::Rect visible_content_rect,
    gfx::Rect clip_rect,
    bool is_clipped,
    float opacity) {
  this->content_to_target_transform = content_to_target_transform;
  this->content_bounds = content_bounds;
  this->visible_content_rect = visible_content_rect;
  this->clip_rect = clip_rect;
  this->is_clipped = is_clipped;
  this->opacity = opacity;
}

}  // namespace cc