Fix crash when using remote DevTools on CrOS WebUI - check for response_headers
[chromium-blink-merge.git] / cc / output / geometry_binding.h
blobcfa21efd1fc1ef2c7bbcdb03b982c1421191d5c2
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"
11 namespace gfx {
12 class RectF;
14 namespace gpu {
15 namespace gles2 {
16 class GLES2Interface;
20 namespace cc {
22 class GeometryBinding {
23 public:
24 GeometryBinding(gpu::gles2::GLES2Interface* gl,
25 const gfx::RectF& quad_vertex_rect);
26 ~GeometryBinding();
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; }
37 private:
38 gpu::gles2::GLES2Interface* gl_;
40 GLuint quad_vertices_vbo_;
41 GLuint quad_elements_vbo_;
43 DISALLOW_COPY_AND_ASSIGN(GeometryBinding);
46 } // namespace cc
48 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_