OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_OUTPUT_GEOMETRY_BINDING_H_ | 5 #ifndef CC_OUTPUT_GEOMETRY_BINDING_H_ |
6 #define CC_OUTPUT_GEOMETRY_BINDING_H_ | 6 #define CC_OUTPUT_GEOMETRY_BINDING_H_ |
7 | 7 |
| 8 #include "base/basictypes.h" |
| 9 |
8 namespace gfx { class RectF; } | 10 namespace gfx { class RectF; } |
9 | 11 |
10 namespace WebKit { class WebGraphicsContext3D; } | 12 namespace WebKit { class WebGraphicsContext3D; } |
11 | 13 |
12 namespace cc { | 14 namespace cc { |
13 | 15 |
14 class GeometryBinding { | 16 class GeometryBinding { |
15 public: | 17 public: |
16 GeometryBinding(WebKit::WebGraphicsContext3D* context, | 18 GeometryBinding(WebKit::WebGraphicsContext3D* context, |
17 const gfx::RectF& quad_vertex_rect); | 19 const gfx::RectF& quad_vertex_rect); |
18 ~GeometryBinding(); | 20 ~GeometryBinding(); |
19 | 21 |
20 void PrepareForDraw(); | 22 void PrepareForDraw(); |
21 | 23 |
22 // All layer shaders share the same attribute locations for the vertex | 24 // All layer shaders share the same attribute locations for the vertex |
23 // positions and texture coordinates. This allows switching shaders without | 25 // positions and texture coordinates. This allows switching shaders without |
24 // rebinding attribute arrays. | 26 // rebinding attribute arrays. |
25 static int PositionAttribLocation() { return 0; } | 27 static int PositionAttribLocation() { return 0; } |
26 static int TexCoordAttribLocation() { return 1; } | 28 static int TexCoordAttribLocation() { return 1; } |
27 static int TriangleIndexAttribLocation() { return 2; } | 29 static int TriangleIndexAttribLocation() { return 2; } |
28 | 30 |
29 private: | 31 private: |
30 WebKit::WebGraphicsContext3D* context_; | 32 WebKit::WebGraphicsContext3D* context_; |
31 | 33 |
32 unsigned quad_vertices_vbo_; | 34 unsigned quad_vertices_vbo_; |
33 unsigned quad_elements_vbo_; | 35 unsigned quad_elements_vbo_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(GeometryBinding); |
34 }; | 38 }; |
35 | 39 |
36 } // namespace cc | 40 } // namespace cc |
37 | 41 |
38 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_ | 42 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_ |
OLD | NEW |