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.
5 #ifndef CC_OUTPUT_GEOMETRY_BINDING_H_
6 #define CC_OUTPUT_GEOMETRY_BINDING_H_
8 #include "base/basictypes.h"
9 #include "third_party/khronos/GLES2/gl2.h"
22 class GeometryBinding
{
24 GeometryBinding(gpu::gles2::GLES2Interface
* gl
,
25 const gfx::RectF
& quad_vertex_rect
);
28 void PrepareForDraw();
30 // All layer shaders share the same attribute locations for the vertex
31 // positions and texture coordinates. This allows switching shaders without
32 // rebinding attribute arrays.
33 static int PositionAttribLocation() { return 0; }
34 static int TexCoordAttribLocation() { return 1; }
35 static int TriangleIndexAttribLocation() { return 2; }
38 gpu::gles2::GLES2Interface
* gl_
;
40 GLuint quad_vertices_vbo_
;
41 GLuint quad_elements_vbo_
;
43 DISALLOW_COPY_AND_ASSIGN(GeometryBinding
);
48 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_