Move onConsoleMessage implementation to chromium layer
[chromium-blink-merge.git] / cc / quads / tile_draw_quad.cc
blobfbdae8888b5ccfbc82d3cf545586ff625f126cb4
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"
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 bool nearest_neighbor) {
30 ContentDrawQuadBase::SetNew(shared_quad_state,
31 DrawQuad::TILED_CONTENT,
32 rect,
33 opaque_rect,
34 visible_rect,
35 tex_coord_rect,
36 texture_size,
37 swizzle_contents,
38 nearest_neighbor);
39 this->resource_id = resource_id;
42 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
43 const gfx::Rect& rect,
44 const gfx::Rect& opaque_rect,
45 const gfx::Rect& visible_rect,
46 bool needs_blending,
47 unsigned resource_id,
48 const gfx::RectF& tex_coord_rect,
49 const gfx::Size& texture_size,
50 bool swizzle_contents,
51 bool nearest_neighbor) {
52 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
53 opaque_rect, visible_rect, needs_blending,
54 tex_coord_rect, texture_size, swizzle_contents,
55 nearest_neighbor);
56 this->resource_id = resource_id;
59 void TileDrawQuad::IterateResources(
60 const ResourceIteratorCallback& callback) {
61 resource_id = callback.Run(resource_id);
64 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) {
65 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
66 return static_cast<const TileDrawQuad*>(quad);
69 void TileDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const {
70 ContentDrawQuadBase::ExtendValue(value);
71 value->SetInteger("resource_id", resource_id);
74 } // namespace cc