Revert 203708 "Disable ico_image_decoder_unittest until the bad ..."
[chromium-blink-merge.git] / cc / quads / tile_draw_quad.cc
blob414b320cb30e02cf6f06a3e08bcd1e435355b015
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 "third_party/khronos/GLES2/gl2.h"
10 namespace cc {
12 TileDrawQuad::TileDrawQuad()
13 : resource_id(0) {
16 TileDrawQuad::~TileDrawQuad() {
19 scoped_ptr<TileDrawQuad> TileDrawQuad::Create() {
20 return make_scoped_ptr(new TileDrawQuad);
23 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
24 gfx::Rect rect,
25 gfx::Rect opaque_rect,
26 unsigned resource_id,
27 const gfx::RectF& tex_coord_rect,
28 gfx::Size texture_size,
29 bool swizzle_contents) {
30 ContentDrawQuadBase::SetNew(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
31 opaque_rect, tex_coord_rect, texture_size,
32 swizzle_contents);
33 this->resource_id = resource_id;
36 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
37 gfx::Rect rect,
38 gfx::Rect opaque_rect,
39 gfx::Rect visible_rect,
40 bool needs_blending,
41 unsigned resource_id,
42 const gfx::RectF& tex_coord_rect,
43 gfx::Size texture_size,
44 bool swizzle_contents) {
45 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
46 opaque_rect, visible_rect, needs_blending,
47 tex_coord_rect, texture_size, swizzle_contents);
48 this->resource_id = resource_id;
51 void TileDrawQuad::IterateResources(
52 const ResourceIteratorCallback& callback) {
53 resource_id = callback.Run(resource_id);
56 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) {
57 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
58 return static_cast<const TileDrawQuad*>(quad);
61 } // namespace cc