| 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" | 8 #include <stdint.h> |
| 9 |
| 9 #include "gpu/command_buffer/client/gles2_interface.h" | 10 #include "gpu/command_buffer/client/gles2_interface.h" |
| 10 #include "third_party/khronos/GLES2/gl2.h" | 11 #include "third_party/khronos/GLES2/gl2.h" |
| 11 #include "third_party/khronos/GLES2/gl2ext.h" | 12 #include "third_party/khronos/GLES2/gl2ext.h" |
| 12 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
| 13 | 14 |
| 14 namespace gfx { | 15 namespace gfx { |
| 15 class QuadF; | 16 class QuadF; |
| 16 class Quad; | 17 class Quad; |
| 17 class QuadIndex; | 18 class QuadIndex; |
| 18 class PointF; | 19 class PointF; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 GeometryBindingQuad(); | 32 GeometryBindingQuad(); |
| 32 GeometryBindingQuad(const GeometryBindingVertex& vert0, | 33 GeometryBindingQuad(const GeometryBindingVertex& vert0, |
| 33 const GeometryBindingVertex& vert1, | 34 const GeometryBindingVertex& vert1, |
| 34 const GeometryBindingVertex& vert2, | 35 const GeometryBindingVertex& vert2, |
| 35 const GeometryBindingVertex& vert3); | 36 const GeometryBindingVertex& vert3); |
| 36 GeometryBindingVertex v0, v1, v2, v3; | 37 GeometryBindingVertex v0, v1, v2, v3; |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 struct GeometryBindingQuadIndex { | 40 struct GeometryBindingQuadIndex { |
| 40 GeometryBindingQuadIndex(); | 41 GeometryBindingQuadIndex(); |
| 41 GeometryBindingQuadIndex(uint16 index0, | 42 GeometryBindingQuadIndex(uint16_t index0, |
| 42 uint16 index1, | 43 uint16_t index1, |
| 43 uint16 index2, | 44 uint16_t index2, |
| 44 uint16 index3, | 45 uint16_t index3, |
| 45 uint16 index4, | 46 uint16_t index4, |
| 46 uint16 index5); | 47 uint16_t index5); |
| 47 | 48 |
| 48 uint16 data[6]; | 49 uint16_t data[6]; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 class DrawQuad; | 52 class DrawQuad; |
| 52 class DrawPolygon; | 53 class DrawPolygon; |
| 53 | 54 |
| 54 struct GeometryBinding { | 55 struct GeometryBinding { |
| 55 // All layer shaders share the same attribute locations for the vertex | 56 // All layer shaders share the same attribute locations for the vertex |
| 56 // positions and texture coordinates. This allows switching shaders without | 57 // positions and texture coordinates. This allows switching shaders without |
| 57 // rebinding attribute arrays. | 58 // rebinding attribute arrays. |
| 58 static int PositionAttribLocation() { return 0; } | 59 static int PositionAttribLocation() { return 0; } |
| 59 static int TexCoordAttribLocation() { return 1; } | 60 static int TexCoordAttribLocation() { return 1; } |
| 60 static int TriangleIndexAttribLocation() { return 2; } | 61 static int TriangleIndexAttribLocation() { return 2; } |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 void SetupGLContext(gpu::gles2::GLES2Interface* gl, | 64 void SetupGLContext(gpu::gles2::GLES2Interface* gl, |
| 64 GLuint quad_elements_vbo, | 65 GLuint quad_elements_vbo, |
| 65 GLuint quad_vertices_vbo); | 66 GLuint quad_vertices_vbo); |
| 66 | 67 |
| 67 } // namespace cc | 68 } // namespace cc |
| 68 | 69 |
| 69 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_ | 70 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_ |
| OLD | NEW |