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" | |
6 | |
7 #include "cc/geometry_binding.h" | 5 #include "cc/geometry_binding.h" |
8 | 6 |
9 #include "cc/gl_renderer.h" // For the GLC() macro. | 7 #include "cc/gl_renderer.h" // For the GLC() macro. |
10 #include "third_party/khronos/GLES2/gl2.h" | 8 #include "third_party/khronos/GLES2/gl2.h" |
11 #include "ui/gfx/rect_f.h" | 9 #include "ui/gfx/rect_f.h" |
12 #include <public/WebGraphicsContext3D.h> | 10 #include <public/WebGraphicsContext3D.h> |
13 | 11 |
14 namespace cc { | 12 namespace cc { |
15 | 13 |
16 GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const gf
x::RectF& quadVertexRect) | 14 GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const gf
x::RectF& quadVertexRect) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 GLC(m_context, m_context->bindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadElementsVb
o())); | 47 GLC(m_context, m_context->bindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadElementsVb
o())); |
50 unsigned offset = 0; | 48 unsigned offset = 0; |
51 GLC(m_context, m_context->vertexAttribPointer(positionAttribLocation(), 3, G
L_FLOAT, false, 5 * sizeof(float), offset)); | 49 GLC(m_context, m_context->vertexAttribPointer(positionAttribLocation(), 3, G
L_FLOAT, false, 5 * sizeof(float), offset)); |
52 offset += 3 * sizeof(float); | 50 offset += 3 * sizeof(float); |
53 GLC(m_context, m_context->vertexAttribPointer(texCoordAttribLocation(), 2, G
L_FLOAT, false, 5 * sizeof(float), offset)); | 51 GLC(m_context, m_context->vertexAttribPointer(texCoordAttribLocation(), 2, G
L_FLOAT, false, 5 * sizeof(float), offset)); |
54 GLC(m_context, m_context->enableVertexAttribArray(positionAttribLocation()))
; | 52 GLC(m_context, m_context->enableVertexAttribArray(positionAttribLocation()))
; |
55 GLC(m_context, m_context->enableVertexAttribArray(texCoordAttribLocation()))
; | 53 GLC(m_context, m_context->enableVertexAttribArray(texCoordAttribLocation()))
; |
56 } | 54 } |
57 | 55 |
58 } // namespace cc | 56 } // namespace cc |
OLD | NEW |