Copy ldb files in ChromiumEnv for the purpose of backups.
[chromium-blink-merge.git] / cc / quads / tile_draw_quad.cc
blob3ff98095e9f0816e6f651d1d28726cf9d4a7325e
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/values.h"
9 #include "third_party/khronos/GLES2/gl2.h"
11 namespace cc {
13 TileDrawQuad::TileDrawQuad()
14 : resource_id(0) {
17 TileDrawQuad::~TileDrawQuad() {
20 scoped_ptr<TileDrawQuad> TileDrawQuad::Create() {
21 return make_scoped_ptr(new TileDrawQuad);
24 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
25 gfx::Rect rect,
26 gfx::Rect opaque_rect,
27 unsigned resource_id,
28 const gfx::RectF& tex_coord_rect,
29 gfx::Size texture_size,
30 bool swizzle_contents) {
31 ContentDrawQuadBase::SetNew(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
32 opaque_rect, tex_coord_rect, texture_size,
33 swizzle_contents);
34 this->resource_id = resource_id;
37 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
38 gfx::Rect rect,
39 gfx::Rect opaque_rect,
40 gfx::Rect visible_rect,
41 bool needs_blending,
42 unsigned resource_id,
43 const gfx::RectF& tex_coord_rect,
44 gfx::Size texture_size,
45 bool swizzle_contents) {
46 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
47 opaque_rect, visible_rect, needs_blending,
48 tex_coord_rect, texture_size, swizzle_contents);
49 this->resource_id = resource_id;
52 void TileDrawQuad::IterateResources(
53 const ResourceIteratorCallback& callback) {
54 resource_id = callback.Run(resource_id);
57 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) {
58 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
59 return static_cast<const TileDrawQuad*>(quad);
62 void TileDrawQuad::ExtendValue(base::DictionaryValue* value) const {
63 ContentDrawQuadBase::ExtendValue(value);
64 value->SetInteger("resource_id", resource_id);
67 } // namespace cc