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 GeometryBinding_h
6 #define GeometryBinding_h
11 class WebGraphicsContext3D
;
16 class GeometryBinding
{
18 GeometryBinding(WebKit::WebGraphicsContext3D
*, const FloatRect
& quadVertexRect
);
21 bool initialized() const { return m_initialized
; }
23 WebKit::WebGraphicsContext3D
* context() const { return m_context
; }
24 unsigned quadVerticesVbo() const { return m_quadVerticesVbo
; }
25 unsigned quadElementsVbo() const { return m_quadElementsVbo
; }
27 void prepareForDraw();
29 // All layer shaders share the same attribute locations for the vertex
30 // positions and texture coordinates. This allows switching shaders without
31 // rebinding attribute arrays.
32 static int positionAttribLocation() { return 0; }
33 static int texCoordAttribLocation() { return 1; }
36 WebKit::WebGraphicsContext3D
* m_context
;
37 unsigned m_quadVerticesVbo
;
38 unsigned m_quadElementsVbo
;