Chromium Code Reviews| Index: cc/output/geometry_binding.h |
| diff --git a/cc/output/geometry_binding.h b/cc/output/geometry_binding.h |
| index cfa21efd1fc1ef2c7bbcdb03b982c1421191d5c2..92814e7246362ad6760cbd149ef4c41b20e22c91 100644 |
| --- a/cc/output/geometry_binding.h |
| +++ b/cc/output/geometry_binding.h |
| @@ -6,33 +6,41 @@ |
| #define CC_OUTPUT_GEOMETRY_BINDING_H_ |
| #include "base/basictypes.h" |
| +#include "cc/output/gl_renderer.h" // For the GLC() macro. |
| +#include "gpu/command_buffer/client/gles2_interface.h" |
| #include "third_party/khronos/GLES2/gl2.h" |
| +#include "third_party/khronos/GLES2/gl2ext.h" |
| +#include "ui/gfx/geometry/rect_f.h" |
| namespace gfx { |
| -class RectF; |
| -} |
| -namespace gpu { |
| -namespace gles2 { |
| -class GLES2Interface; |
| -} |
| +class QuadF; |
| +class Quad; |
| +class QuadIndex; |
| +class PointF; |
| } |
| +using gpu::gles2::GLES2Interface; |
| namespace cc { |
| -class GeometryBinding { |
| - public: |
| - GeometryBinding(gpu::gles2::GLES2Interface* gl, |
| - const gfx::RectF& quad_vertex_rect); |
| - ~GeometryBinding(); |
| - |
| - void PrepareForDraw(); |
| +class DrawQuad; |
| +class DrawPolygon; |
| +struct GeometryBinding { |
| // All layer shaders share the same attribute locations for the vertex |
| // positions and texture coordinates. This allows switching shaders without |
| // rebinding attribute arrays. |
| static int PositionAttribLocation() { return 0; } |
| static int TexCoordAttribLocation() { return 1; } |
| static int TriangleIndexAttribLocation() { return 2; } |
| +}; |
| + |
| +class StaticGeometryBinding { |
|
enne (OOO)
2015/02/04 21:23:59
Can you put the different bindings in different he
awoloszyn
2015/02/12 16:48:51
Done.
|
| + public: |
| + StaticGeometryBinding(gpu::gles2::GLES2Interface* gl, |
| + const gfx::RectF& quad_vertex_rect); |
| + ~StaticGeometryBinding(); |
| + |
| + void PrepareForDraw(); |
| private: |
| gpu::gles2::GLES2Interface* gl_; |
| @@ -40,7 +48,22 @@ class GeometryBinding { |
| GLuint quad_vertices_vbo_; |
| GLuint quad_elements_vbo_; |
| - DISALLOW_COPY_AND_ASSIGN(GeometryBinding); |
| + DISALLOW_COPY_AND_ASSIGN(StaticGeometryBinding); |
| +}; |
| + |
| +class DynamicGeometryBinding { |
| + public: |
| + explicit DynamicGeometryBinding(gpu::gles2::GLES2Interface* gl); |
| + void PrepareForDraw(); |
| + void InitializeCustomQuad(const gfx::QuadF& quad); |
| + void InitializeCustomQuadWithUVs(const gfx::QuadF& quad, const float uv[8]); |
|
enne (OOO)
2015/02/04 21:23:59
const float& uv[8]
awoloszyn
2015/02/12 16:48:51
Done.
|
| + |
| + private: |
| + gpu::gles2::GLES2Interface* gl_; |
| + |
| + GLuint quad_vertices_vbo_; |
| + GLuint quad_elements_vbo_; |
| + DISALLOW_COPY_AND_ASSIGN(DynamicGeometryBinding); |
| }; |
| } // namespace cc |