| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_GEOMETRY_BINDING_H_ | |
| 6 #define CC_GEOMETRY_BINDING_H_ | |
| 7 | |
| 8 namespace gfx { class RectF; } | |
| 9 | |
| 10 namespace WebKit { class WebGraphicsContext3D; } | |
| 11 | |
| 12 namespace cc { | |
| 13 | |
| 14 class GeometryBinding { | |
| 15 public: | |
| 16 GeometryBinding(WebKit::WebGraphicsContext3D* context, | |
| 17 const gfx::RectF& quad_vertex_rect); | |
| 18 ~GeometryBinding(); | |
| 19 | |
| 20 void PrepareForDraw(); | |
| 21 | |
| 22 // All layer shaders share the same attribute locations for the vertex | |
| 23 // positions and texture coordinates. This allows switching shaders without | |
| 24 // rebinding attribute arrays. | |
| 25 static int PositionAttribLocation() { return 0; } | |
| 26 static int TexCoordAttribLocation() { return 1; } | |
| 27 static int TriangleIndexAttribLocation() { return 2; } | |
| 28 | |
| 29 private: | |
| 30 WebKit::WebGraphicsContext3D* context_; | |
| 31 | |
| 32 unsigned quad_vertices_vbo_; | |
| 33 unsigned quad_elements_vbo_; | |
| 34 }; | |
| 35 | |
| 36 } // namespace cc | |
| 37 | |
| 38 #endif // CC_GEOMETRY_BINDING_H_ | |
| OLD | NEW |