Cleanup: Only build extensions renderer code when extensions are enabled.
[chromium-blink-merge.git] / cc / quads / tile_draw_quad.cc
blobea3a14a9a3af1c9b9f9a94ce9410dc56aac9a251
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/debug/trace_event_argument.h"
8 #include "base/logging.h"
9 #include "base/values.h"
10 #include "third_party/khronos/GLES2/gl2.h"
12 namespace cc {
14 TileDrawQuad::TileDrawQuad()
15 : resource_id(0) {
18 TileDrawQuad::~TileDrawQuad() {
21 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
22 const gfx::Rect& rect,
23 const gfx::Rect& opaque_rect,
24 const gfx::Rect& visible_rect,
25 unsigned resource_id,
26 const gfx::RectF& tex_coord_rect,
27 const gfx::Size& texture_size,
28 bool swizzle_contents) {
29 ContentDrawQuadBase::SetNew(shared_quad_state,
30 DrawQuad::TILED_CONTENT,
31 rect,
32 opaque_rect,
33 visible_rect,
34 tex_coord_rect,
35 texture_size,
36 swizzle_contents);
37 this->resource_id = resource_id;
40 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
41 const gfx::Rect& rect,
42 const gfx::Rect& opaque_rect,
43 const gfx::Rect& visible_rect,
44 bool needs_blending,
45 unsigned resource_id,
46 const gfx::RectF& tex_coord_rect,
47 const gfx::Size& texture_size,
48 bool swizzle_contents) {
49 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
50 opaque_rect, visible_rect, needs_blending,
51 tex_coord_rect, texture_size, swizzle_contents);
52 this->resource_id = resource_id;
55 void TileDrawQuad::IterateResources(
56 const ResourceIteratorCallback& callback) {
57 resource_id = callback.Run(resource_id);
60 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) {
61 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
62 return static_cast<const TileDrawQuad*>(quad);
65 void TileDrawQuad::ExtendValue(base::debug::TracedValue* value) const {
66 ContentDrawQuadBase::ExtendValue(value);
67 value->SetInteger("resource_id", resource_id);
70 } // namespace cc