Setup a experiment to enable background tracing.
[chromium-blink-merge.git] / cc / quads / tile_draw_quad.cc
blob02c4a1e25a5f9f175be4c66e389a8a914cda6564
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/quads/tile_draw_quad.h"
7 #include "base/logging.h"
8 #include "base/trace_event/trace_event_argument.h"
9 #include "base/values.h"
11 namespace cc {
13 TileDrawQuad::TileDrawQuad() {
16 TileDrawQuad::~TileDrawQuad() {
19 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
20 const gfx::Rect& rect,
21 const gfx::Rect& opaque_rect,
22 const gfx::Rect& visible_rect,
23 unsigned resource_id,
24 const gfx::RectF& tex_coord_rect,
25 const gfx::Size& texture_size,
26 bool swizzle_contents,
27 bool nearest_neighbor) {
28 ContentDrawQuadBase::SetNew(shared_quad_state,
29 DrawQuad::TILED_CONTENT,
30 rect,
31 opaque_rect,
32 visible_rect,
33 tex_coord_rect,
34 texture_size,
35 swizzle_contents,
36 nearest_neighbor);
37 resources.ids[kResourceIdIndex] = resource_id;
38 resources.count = 1;
41 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
42 const gfx::Rect& rect,
43 const gfx::Rect& opaque_rect,
44 const gfx::Rect& visible_rect,
45 bool needs_blending,
46 unsigned resource_id,
47 const gfx::RectF& tex_coord_rect,
48 const gfx::Size& texture_size,
49 bool swizzle_contents,
50 bool nearest_neighbor) {
51 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
52 opaque_rect, visible_rect, needs_blending,
53 tex_coord_rect, texture_size, swizzle_contents,
54 nearest_neighbor);
55 resources.ids[kResourceIdIndex] = resource_id;
56 resources.count = 1;
59 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) {
60 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
61 return static_cast<const TileDrawQuad*>(quad);
64 void TileDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const {
65 ContentDrawQuadBase::ExtendValue(value);
66 value->SetInteger("resource_id", resources.ids[kResourceIdIndex]);
69 } // namespace cc