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 #ifndef CC_QUADS_TILE_DRAW_QUAD_H_
6 #define CC_QUADS_TILE_DRAW_QUAD_H_
8 #include "cc/quads/content_draw_quad_base.h"
12 class CC_EXPORT TileDrawQuad
: public ContentDrawQuadBase
{
15 ~TileDrawQuad() override
;
17 void SetNew(const SharedQuadState
* shared_quad_state
,
18 const gfx::Rect
& rect
,
19 const gfx::Rect
& opaque_rect
,
20 const gfx::Rect
& visible_rect
,
22 // |tex_coord_rect| contains non-normalized coordinates.
23 // TODO(reveman): Make the use of normalized vs non-normalized
24 // coordinates consistent across all quad types: crbug.com/487370
25 const gfx::RectF
& tex_coord_rect
,
26 const gfx::Size
& texture_size
,
27 bool swizzle_contents
,
28 bool nearest_neighbor
);
30 void SetAll(const SharedQuadState
* shared_quad_state
,
31 const gfx::Rect
& rect
,
32 const gfx::Rect
& opaque_rect
,
33 const gfx::Rect
& visible_rect
,
36 // |tex_coord_rect| contains non-normalized coordinates.
37 // TODO(reveman): Make the use of normalized vs non-normalized
38 // coordinates consistent across all quad types: crbug.com/487370
39 const gfx::RectF
& tex_coord_rect
,
40 const gfx::Size
& texture_size
,
41 bool swizzle_contents
,
42 bool nearest_neighbor
);
44 static const TileDrawQuad
* MaterialCast(const DrawQuad
*);
46 ResourceId
resource_id() const { return resources
.ids
[kResourceIdIndex
]; }
49 static const size_t kResourceIdIndex
= 0;
51 void ExtendValue(base::trace_event::TracedValue
* value
) const override
;
56 #endif // CC_QUADS_TILE_DRAW_QUAD_H_