OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "core/html/canvas/ANGLEInstancedArrays.h" | 33 #include "core/html/canvas/ANGLEInstancedArrays.h" |
34 | 34 |
35 #include "core/html/canvas/WebGLRenderingContext.h" | 35 #include "core/html/canvas/WebGLRenderingContext.h" |
36 #include "platform/graphics/Extensions3D.h" | |
37 | 36 |
38 namespace WebCore { | 37 namespace WebCore { |
39 | 38 |
40 ANGLEInstancedArrays::ANGLEInstancedArrays(WebGLRenderingContext* context) | 39 ANGLEInstancedArrays::ANGLEInstancedArrays(WebGLRenderingContext* context) |
41 : WebGLExtension(context) | 40 : WebGLExtension(context) |
42 { | 41 { |
43 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
44 context->graphicsContext3D()->extensions()->ensureEnabled("GL_ANGLE_instance
d_arrays"); | 43 context->graphicsContext3D()->ensureExtensionEnabled("GL_ANGLE_instanced_arr
ays"); |
45 } | 44 } |
46 | 45 |
47 ANGLEInstancedArrays::~ANGLEInstancedArrays() | 46 ANGLEInstancedArrays::~ANGLEInstancedArrays() |
48 { | 47 { |
49 } | 48 } |
50 | 49 |
51 WebGLExtension::ExtensionName ANGLEInstancedArrays::name() const | 50 WebGLExtension::ExtensionName ANGLEInstancedArrays::name() const |
52 { | 51 { |
53 return ANGLEInstancedArraysName; | 52 return ANGLEInstancedArraysName; |
54 } | 53 } |
55 | 54 |
56 PassRefPtr<ANGLEInstancedArrays> ANGLEInstancedArrays::create(WebGLRenderingCont
ext* context) | 55 PassRefPtr<ANGLEInstancedArrays> ANGLEInstancedArrays::create(WebGLRenderingCont
ext* context) |
57 { | 56 { |
58 return adoptRef(new ANGLEInstancedArrays(context)); | 57 return adoptRef(new ANGLEInstancedArrays(context)); |
59 } | 58 } |
60 | 59 |
61 bool ANGLEInstancedArrays::supported(WebGLRenderingContext* context) | 60 bool ANGLEInstancedArrays::supported(WebGLRenderingContext* context) |
62 { | 61 { |
63 Extensions3D* extensions = context->graphicsContext3D()->extensions(); | 62 return context->graphicsContext3D()->supportsExtension("GL_ANGLE_instanced_a
rrays"); |
64 return extensions->supports("GL_ANGLE_instanced_arrays"); | |
65 } | 63 } |
66 | 64 |
67 const char* ANGLEInstancedArrays::extensionName() | 65 const char* ANGLEInstancedArrays::extensionName() |
68 { | 66 { |
69 return "ANGLE_instanced_arrays"; | 67 return "ANGLE_instanced_arrays"; |
70 } | 68 } |
71 | 69 |
72 void ANGLEInstancedArrays::drawArraysInstancedANGLE(GLenum mode, GLint first, GL
sizei count, GLsizei primcount) | 70 void ANGLEInstancedArrays::drawArraysInstancedANGLE(GLenum mode, GLint first, GL
sizei count, GLsizei primcount) |
73 { | 71 { |
74 if (isLost()) | 72 if (isLost()) |
(...skipping 12 matching lines...) Expand all Loading... |
87 | 85 |
88 void ANGLEInstancedArrays::vertexAttribDivisorANGLE(GLuint index, GLuint divisor
) | 86 void ANGLEInstancedArrays::vertexAttribDivisorANGLE(GLuint index, GLuint divisor
) |
89 { | 87 { |
90 if (isLost()) | 88 if (isLost()) |
91 return; | 89 return; |
92 | 90 |
93 m_context->vertexAttribDivisorANGLE(index, divisor); | 91 m_context->vertexAttribDivisorANGLE(index, divisor); |
94 } | 92 } |
95 | 93 |
96 } // namespace WebCore | 94 } // namespace WebCore |
OLD | NEW |