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 #ifndef GeometryBinding_h | 5 #ifndef GeometryBinding_h |
6 #define GeometryBinding_h | 6 #define GeometryBinding_h |
7 | 7 |
8 #include "FloatRect.h" | 8 #include "FloatRect.h" |
9 | 9 |
10 #if USE(ACCELERATED_COMPOSITING) | 10 #if USE(ACCELERATED_COMPOSITING) |
11 | 11 |
12 namespace WebKit { | 12 namespace WebKit { |
13 class WebGraphicsContext3D; | 13 class WebGraphicsContext3D; |
14 } | 14 } |
15 | 15 |
16 namespace WebCore { | 16 namespace cc { |
17 | 17 |
18 class GeometryBinding { | 18 class GeometryBinding { |
19 public: | 19 public: |
20 GeometryBinding(WebKit::WebGraphicsContext3D*, const FloatRect& quadVertexRe
ct); | 20 GeometryBinding(WebKit::WebGraphicsContext3D*, const FloatRect& quadVertexRe
ct); |
21 ~GeometryBinding(); | 21 ~GeometryBinding(); |
22 | 22 |
23 bool initialized() const { return m_initialized; } | 23 bool initialized() const { return m_initialized; } |
24 | 24 |
25 WebKit::WebGraphicsContext3D* context() const { return m_context; } | 25 WebKit::WebGraphicsContext3D* context() const { return m_context; } |
26 unsigned quadVerticesVbo() const { return m_quadVerticesVbo; } | 26 unsigned quadVerticesVbo() const { return m_quadVerticesVbo; } |
27 unsigned quadElementsVbo() const { return m_quadElementsVbo; } | 27 unsigned quadElementsVbo() const { return m_quadElementsVbo; } |
28 | 28 |
29 void prepareForDraw(); | 29 void prepareForDraw(); |
30 | 30 |
31 // All layer shaders share the same attribute locations for the vertex | 31 // All layer shaders share the same attribute locations for the vertex |
32 // positions and texture coordinates. This allows switching shaders without | 32 // positions and texture coordinates. This allows switching shaders without |
33 // rebinding attribute arrays. | 33 // rebinding attribute arrays. |
34 static int positionAttribLocation() { return 0; } | 34 static int positionAttribLocation() { return 0; } |
35 static int texCoordAttribLocation() { return 1; } | 35 static int texCoordAttribLocation() { return 1; } |
36 | 36 |
37 private: | 37 private: |
38 WebKit::WebGraphicsContext3D* m_context; | 38 WebKit::WebGraphicsContext3D* m_context; |
39 unsigned m_quadVerticesVbo; | 39 unsigned m_quadVerticesVbo; |
40 unsigned m_quadElementsVbo; | 40 unsigned m_quadElementsVbo; |
41 bool m_initialized; | 41 bool m_initialized; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace WebCore | 44 } // namespace cc |
45 | 45 |
46 #endif // USE(ACCELERATED_COMPOSITING) | 46 #endif // USE(ACCELERATED_COMPOSITING) |
47 | 47 |
48 #endif | 48 #endif |
OLD | NEW |