blob: ae41d4abcccdbd905cad847825475793a37145a3 [file] [log] [blame]
[email protected]0fb25002012-10-12 07:20:021// 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.
[email protected]cd57cc5a2012-10-12 22:43:414
[email protected]8fcbaa372012-11-05 04:12:415#ifndef CC_TILE_DRAW_QUAD_H_
6#define CC_TILE_DRAW_QUAD_H_
[email protected]cd57cc5a2012-10-12 22:43:417
[email protected]cd57cc5a2012-10-12 22:43:418#include "base/memory/scoped_ptr.h"
[email protected]52347c842012-11-02 21:06:209#include "cc/cc_export.h"
[email protected]aa0a9d32012-10-24 01:58:1010#include "cc/draw_quad.h"
11#include "third_party/khronos/GLES2/gl2.h"
[email protected]1fea8142012-10-20 04:12:4112#include "ui/gfx/point.h"
13#include "ui/gfx/size.h"
[email protected]cd57cc5a2012-10-12 22:43:4114
15namespace cc {
16
[email protected]52347c842012-11-02 21:06:2017class CC_EXPORT TileDrawQuad : public DrawQuad {
[email protected]c22418b2012-11-20 23:06:2618 public:
19 static scoped_ptr<TileDrawQuad> Create();
[email protected]cd57cc5a2012-10-12 22:43:4120
[email protected]c22418b2012-11-20 23:06:2621 void SetNew(const SharedQuadState* shared_quad_state,
22 gfx::Rect rect,
23 gfx::Rect opaque_rect,
24 unsigned resource_id,
25 const gfx::RectF& tex_coord_rect,
26 gfx::Size texture_size,
27 bool swizzle_contents,
28 bool left_edge_aa,
29 bool top_edge_aa,
30 bool right_edge_aa,
31 bool bottom_edge_aa);
[email protected]cd57cc5a2012-10-12 22:43:4132
[email protected]c22418b2012-11-20 23:06:2633 void SetAll(const SharedQuadState* shared_quad_state,
34 gfx::Rect rect,
35 gfx::Rect opaque_rect,
36 gfx::Rect visible_rect,
37 bool needs_blending,
38 unsigned resource_id,
39 const gfx::RectF& tex_coord_rect,
40 gfx::Size texture_size,
41 bool swizzle_contents,
42 bool left_edge_aa,
43 bool top_edge_aa,
44 bool right_edge_aa,
45 bool bottom_edge_aa);
[email protected]cd57cc5a2012-10-12 22:43:4146
[email protected]c22418b2012-11-20 23:06:2647 unsigned resource_id;
48 gfx::RectF tex_coord_rect;
49 gfx::Size texture_size;
50 bool swizzle_contents;
[email protected]cd57cc5a2012-10-12 22:43:4151
[email protected]c22418b2012-11-20 23:06:2652 // TODO(danakj): Stick the data used to compute these things in the quad
53 // instead so the parent compositor can decide to use AA on its own.
54 bool left_edge_aa;
55 bool top_edge_aa;
56 bool right_edge_aa;
57 bool bottom_edge_aa;
[email protected]cd57cc5a2012-10-12 22:43:4158
[email protected]c22418b2012-11-20 23:06:2659 bool IsAntialiased() const {
60 return left_edge_aa || top_edge_aa || right_edge_aa || bottom_edge_aa;
61 }
62
63 static const TileDrawQuad* MaterialCast(const DrawQuad*);
64 private:
65 TileDrawQuad();
[email protected]cd57cc5a2012-10-12 22:43:4166};
67
[email protected]cd57cc5a2012-10-12 22:43:4168}
69
[email protected]8fcbaa372012-11-05 04:12:4170#endif // CC_TILE_DRAW_QUAD_H_