chrome.windows.create should return new window id in Guest mode
[chromium-blink-merge.git] / cc / output / geometry_binding.h
blob2318b27ecff41106d92e84f91aea1dc3d50b45c0
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 CC_OUTPUT_GEOMETRY_BINDING_H_
6 #define CC_OUTPUT_GEOMETRY_BINDING_H_
8 #include "base/basictypes.h"
10 namespace gfx { class RectF; }
12 namespace WebKit { class WebGraphicsContext3D; }
14 namespace cc {
16 class GeometryBinding {
17 public:
18 GeometryBinding(WebKit::WebGraphicsContext3D* context,
19 const gfx::RectF& quad_vertex_rect);
20 ~GeometryBinding();
22 void PrepareForDraw();
24 // All layer shaders share the same attribute locations for the vertex
25 // positions and texture coordinates. This allows switching shaders without
26 // rebinding attribute arrays.
27 static int PositionAttribLocation() { return 0; }
28 static int TexCoordAttribLocation() { return 1; }
29 static int TriangleIndexAttribLocation() { return 2; }
31 private:
32 WebKit::WebGraphicsContext3D* context_;
34 unsigned quad_vertices_vbo_;
35 unsigned quad_elements_vbo_;
37 DISALLOW_COPY_AND_ASSIGN(GeometryBinding);
40 } // namespace cc
42 #endif // CC_OUTPUT_GEOMETRY_BINDING_H_