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

Side by Side Diff: cc/tile_draw_quad.h

Issue 11418047: cc: Turn DrawQuad into a struct-like class with public data members. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no virtual for SetAll() 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/texture_draw_quad.cc ('k') | cc/tile_draw_quad.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TILE_DRAW_QUAD_H_ 5 #ifndef CC_TILE_DRAW_QUAD_H_
6 #define CC_TILE_DRAW_QUAD_H_ 6 #define CC_TILE_DRAW_QUAD_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/draw_quad.h" 10 #include "cc/draw_quad.h"
11 #include "third_party/khronos/GLES2/gl2.h" 11 #include "third_party/khronos/GLES2/gl2.h"
12 #include "ui/gfx/point.h" 12 #include "ui/gfx/point.h"
13 #include "ui/gfx/size.h" 13 #include "ui/gfx/size.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class CC_EXPORT TileDrawQuad : public DrawQuad { 17 class CC_EXPORT TileDrawQuad : public DrawQuad {
18 public: 18 public:
19 static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Re ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vecto r2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool lef tEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); 19 static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Re ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vecto r2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool lef tEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA);
20 20
21 unsigned resourceId() const { return m_resourceId; } 21 unsigned resourceId() const { return m_resourceId; }
22 gfx::Vector2d textureOffset() const { return m_textureOffset; } 22 gfx::Vector2d textureOffset() const { return m_textureOffset; }
23 gfx::Size textureSize() const { return m_textureSize; } 23 gfx::Size textureSize() const { return m_textureSize; }
24 bool swizzleContents() const { return m_swizzleContents; } 24 bool swizzleContents() const { return m_swizzleContents; }
25 25
26 // TODO(danakj): Stick the data used to compute these things in the quad
27 // instead so the parent compositor can decide to use AA on its own.
26 bool leftEdgeAA() const { return m_leftEdgeAA; } 28 bool leftEdgeAA() const { return m_leftEdgeAA; }
27 bool topEdgeAA() const { return m_topEdgeAA; } 29 bool topEdgeAA() const { return m_topEdgeAA; }
28 bool rightEdgeAA() const { return m_rightEdgeAA; } 30 bool rightEdgeAA() const { return m_rightEdgeAA; }
29 bool bottomEdgeAA() const { return m_bottomEdgeAA; } 31 bool bottomEdgeAA() const { return m_bottomEdgeAA; }
30 32
31 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdge AA() || bottomEdgeAA(); } 33 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdge AA() || bottomEdgeAA(); }
32 34
33 static const TileDrawQuad* materialCast(const DrawQuad*); 35 static const TileDrawQuad* materialCast(const DrawQuad*);
34 private: 36 private:
35 TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::R ect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, b ool rightEdgeAA, bool bottomEdgeAA); 37 TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::R ect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, b ool rightEdgeAA, bool bottomEdgeAA);
36 38
37 unsigned m_resourceId; 39 unsigned m_resourceId;
38 gfx::Vector2d m_textureOffset; 40 gfx::Vector2d m_textureOffset;
39 gfx::Size m_textureSize; 41 gfx::Size m_textureSize;
40 bool m_swizzleContents; 42 bool m_swizzleContents;
41 bool m_leftEdgeAA; 43 bool m_leftEdgeAA;
42 bool m_topEdgeAA; 44 bool m_topEdgeAA;
43 bool m_rightEdgeAA; 45 bool m_rightEdgeAA;
44 bool m_bottomEdgeAA; 46 bool m_bottomEdgeAA;
45 }; 47 };
46 48
47 } 49 }
48 50
49 #endif // CC_TILE_DRAW_QUAD_H_ 51 #endif // CC_TILE_DRAW_QUAD_H_
OLDNEW
« no previous file with comments | « cc/texture_draw_quad.cc ('k') | cc/tile_draw_quad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698