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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "GeometryBinding.h" | 7 #include "cc/geometry_binding.h" |
8 | 8 |
9 #include "CCRendererGL.h" // For the GLC() macro. | 9 #include "CCRendererGL.h" // For the GLC() macro. |
10 #include "GraphicsContext3D.h" | 10 #include "GraphicsContext3D.h" |
11 #include <public/WebGraphicsContext3D.h> | 11 #include <public/WebGraphicsContext3D.h> |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const Fl
oatRect& quadVertexRect) | 15 GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const Fl
oatRect& quadVertexRect) |
16 : m_context(context) | 16 : m_context(context) |
17 , m_quadVerticesVbo(0) | 17 , m_quadVerticesVbo(0) |
(...skipping 30 matching lines...) Expand all Loading... |
48 GLC(m_context, m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER
, quadElementsVbo())); | 48 GLC(m_context, m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER
, quadElementsVbo())); |
49 unsigned offset = 0; | 49 unsigned offset = 0; |
50 GLC(m_context, m_context->vertexAttribPointer(positionAttribLocation(), 3, G
raphicsContext3D::FLOAT, false, 5 * sizeof(float), offset)); | 50 GLC(m_context, m_context->vertexAttribPointer(positionAttribLocation(), 3, G
raphicsContext3D::FLOAT, false, 5 * sizeof(float), offset)); |
51 offset += 3 * sizeof(float); | 51 offset += 3 * sizeof(float); |
52 GLC(m_context, m_context->vertexAttribPointer(texCoordAttribLocation(), 2, G
raphicsContext3D::FLOAT, false, 5 * sizeof(float), offset)); | 52 GLC(m_context, m_context->vertexAttribPointer(texCoordAttribLocation(), 2, G
raphicsContext3D::FLOAT, false, 5 * sizeof(float), offset)); |
53 GLC(m_context, m_context->enableVertexAttribArray(positionAttribLocation()))
; | 53 GLC(m_context, m_context->enableVertexAttribArray(positionAttribLocation()))
; |
54 GLC(m_context, m_context->enableVertexAttribArray(texCoordAttribLocation()))
; | 54 GLC(m_context, m_context->enableVertexAttribArray(texCoordAttribLocation()))
; |
55 } | 55 } |
56 | 56 |
57 } // namespace cc | 57 } // namespace cc |
OLD | NEW |