Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: cc/tile_draw_quad.h

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/texture_layer_impl.cc ('k') | cc/tile_draw_quad.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_draw_quad.h
diff --git a/cc/tile_draw_quad.h b/cc/tile_draw_quad.h
index dccf8bcd948c3ecdc3fbd40cec0c3439b14bbdde..ae41d4abcccdbd905cad847825475793a37145a3 100644
--- a/cc/tile_draw_quad.h
+++ b/cc/tile_draw_quad.h
@@ -15,35 +15,54 @@
namespace cc {
class CC_EXPORT TileDrawQuad : public DrawQuad {
-public:
- static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::RectF& texCoordRect, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA);
-
- unsigned resourceId() const { return m_resourceId; }
- gfx::RectF texCoordRect() const { return m_texCoordRect; }
- gfx::Size textureSize() const { return m_textureSize; }
- bool swizzleContents() const { return m_swizzleContents; }
-
- // TODO(danakj): Stick the data used to compute these things in the quad
- // instead so the parent compositor can decide to use AA on its own.
- bool leftEdgeAA() const { return m_leftEdgeAA; }
- bool topEdgeAA() const { return m_topEdgeAA; }
- bool rightEdgeAA() const { return m_rightEdgeAA; }
- bool bottomEdgeAA() const { return m_bottomEdgeAA; }
-
- bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdgeAA() || bottomEdgeAA(); }
-
- static const TileDrawQuad* materialCast(const DrawQuad*);
-private:
- TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::RectF& texCoordRect, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA);
-
- unsigned m_resourceId;
- gfx::RectF m_texCoordRect;
- gfx::Size m_textureSize;
- bool m_swizzleContents;
- bool m_leftEdgeAA;
- bool m_topEdgeAA;
- bool m_rightEdgeAA;
- bool m_bottomEdgeAA;
+ public:
+ static scoped_ptr<TileDrawQuad> Create();
+
+ void SetNew(const SharedQuadState* shared_quad_state,
+ gfx::Rect rect,
+ gfx::Rect opaque_rect,
+ unsigned resource_id,
+ const gfx::RectF& tex_coord_rect,
+ gfx::Size texture_size,
+ bool swizzle_contents,
+ bool left_edge_aa,
+ bool top_edge_aa,
+ bool right_edge_aa,
+ bool bottom_edge_aa);
+
+ void SetAll(const SharedQuadState* shared_quad_state,
+ gfx::Rect rect,
+ gfx::Rect opaque_rect,
+ gfx::Rect visible_rect,
+ bool needs_blending,
+ unsigned resource_id,
+ const gfx::RectF& tex_coord_rect,
+ gfx::Size texture_size,
+ bool swizzle_contents,
+ bool left_edge_aa,
+ bool top_edge_aa,
+ bool right_edge_aa,
+ bool bottom_edge_aa);
+
+ unsigned resource_id;
+ gfx::RectF tex_coord_rect;
+ gfx::Size texture_size;
+ bool swizzle_contents;
+
+ // TODO(danakj): Stick the data used to compute these things in the quad
+ // instead so the parent compositor can decide to use AA on its own.
+ bool left_edge_aa;
+ bool top_edge_aa;
+ bool right_edge_aa;
+ bool bottom_edge_aa;
+
+ bool IsAntialiased() const {
+ return left_edge_aa || top_edge_aa || right_edge_aa || bottom_edge_aa;
+ }
+
+ static const TileDrawQuad* MaterialCast(const DrawQuad*);
+ private:
+ TileDrawQuad();
};
}
« no previous file with comments | « cc/texture_layer_impl.cc ('k') | cc/tile_draw_quad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698