OLD | NEW |
1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
2 // All rights reserved. | 2 // 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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "config.h" | 30 #include "config.h" |
31 | 31 |
32 #if ENABLE(WEBGL) | 32 #if ENABLE(WEBGL) |
33 | 33 |
34 #include "DartWebGLRenderingContext.h" | 34 #include "DartWebGLRenderingContext.h" |
35 | 35 |
36 #include "DartArrayBufferView.h" | 36 #include "DartArrayBufferView.h" |
37 #include "DartArrayBufferViewCustom.h" | 37 #include "DartArrayBufferViewCustom.h" |
38 #include "DartDOMWrapper.h" | 38 #include "DartDOMWrapper.h" |
| 39 #include "DartEXTDrawBuffers.h" |
39 #include "DartEXTTextureFilterAnisotropic.h" | 40 #include "DartEXTTextureFilterAnisotropic.h" |
40 #include "DartFloat32Array.h" | 41 #include "DartFloat32Array.h" |
41 #include "DartHTMLCanvasElement.h" | 42 #include "DartHTMLCanvasElement.h" |
42 #include "DartHTMLImageElement.h" | 43 #include "DartHTMLImageElement.h" |
43 #include "DartHTMLVideoElement.h" | 44 #include "DartHTMLVideoElement.h" |
44 #include "DartImageData.h" | 45 #include "DartImageData.h" |
45 #include "DartInt16Array.h" | 46 #include "DartInt16Array.h" |
46 #include "DartInt32Array.h" | 47 #include "DartInt32Array.h" |
47 #include "DartInt8Array.h" | 48 #include "DartInt8Array.h" |
| 49 #include "DartOESElementIndexUint.h" |
48 #include "DartOESStandardDerivatives.h" | 50 #include "DartOESStandardDerivatives.h" |
49 #include "DartOESTextureFloat.h" | 51 #include "DartOESTextureFloat.h" |
| 52 #include "DartOESTextureHalfFloat.h" |
50 #include "DartOESVertexArrayObject.h" | 53 #include "DartOESVertexArrayObject.h" |
51 #include "DartUint16Array.h" | 54 #include "DartUint16Array.h" |
52 #include "DartUint32Array.h" | 55 #include "DartUint32Array.h" |
53 #include "DartUint8Array.h" | 56 #include "DartUint8Array.h" |
54 #include "DartWebGLBuffer.h" | 57 #include "DartWebGLBuffer.h" |
55 #include "DartWebGLCompressedTextureS3TC.h" | 58 #include "DartWebGLCompressedTextureS3TC.h" |
56 #include "DartWebGLDebugRendererInfo.h" | 59 #include "DartWebGLDebugRendererInfo.h" |
57 #include "DartWebGLDebugShaders.h" | 60 #include "DartWebGLDebugShaders.h" |
58 #include "DartWebGLDepthTexture.h" | 61 #include "DartWebGLDepthTexture.h" |
59 #include "DartWebGLFramebuffer.h" | 62 #include "DartWebGLFramebuffer.h" |
(...skipping 30 matching lines...) Expand all Loading... |
90 return list; | 93 return list; |
91 } | 94 } |
92 | 95 |
93 static Dart_Handle webGLExtensionToDart(WebGLExtension* extension) | 96 static Dart_Handle webGLExtensionToDart(WebGLExtension* extension) |
94 { | 97 { |
95 if (!extension) | 98 if (!extension) |
96 return Dart_Null(); | 99 return Dart_Null(); |
97 switch (extension->getName()) { | 100 switch (extension->getName()) { |
98 case WebGLExtension::WebGLLoseContextName: | 101 case WebGLExtension::WebGLLoseContextName: |
99 return DartWebGLLoseContext::toDart(static_cast<WebGLLoseContext*>(exten
sion)); | 102 return DartWebGLLoseContext::toDart(static_cast<WebGLLoseContext*>(exten
sion)); |
| 103 case WebGLExtension::EXTDrawBuffersName: |
| 104 return DartEXTDrawBuffers::toDart(static_cast<EXTDrawBuffers*>(extension
)); |
100 case WebGLExtension::EXTTextureFilterAnisotropicName: | 105 case WebGLExtension::EXTTextureFilterAnisotropicName: |
101 return DartEXTTextureFilterAnisotropic::toDart(static_cast<EXTTextureFil
terAnisotropic*>(extension)); | 106 return DartEXTTextureFilterAnisotropic::toDart(static_cast<EXTTextureFil
terAnisotropic*>(extension)); |
102 case WebGLExtension::OESStandardDerivativesName: | 107 case WebGLExtension::OESStandardDerivativesName: |
103 return DartOESStandardDerivatives::toDart(static_cast<OESStandardDerivat
ives*>(extension)); | 108 return DartOESStandardDerivatives::toDart(static_cast<OESStandardDerivat
ives*>(extension)); |
104 case WebGLExtension::OESTextureFloatName: | 109 case WebGLExtension::OESTextureFloatName: |
105 return DartOESTextureFloat::toDart(static_cast<OESTextureFloat*>(extensi
on)); | 110 return DartOESTextureFloat::toDart(static_cast<OESTextureFloat*>(extensi
on)); |
| 111 case WebGLExtension::OESTextureHalfFloatName: |
| 112 return DartOESTextureHalfFloat::toDart(static_cast<OESTextureHalfFloat*>
(extension)); |
106 case WebGLExtension::OESVertexArrayObjectName: | 113 case WebGLExtension::OESVertexArrayObjectName: |
107 return DartOESVertexArrayObject::toDart(static_cast<OESVertexArrayObject
*>(extension)); | 114 return DartOESVertexArrayObject::toDart(static_cast<OESVertexArrayObject
*>(extension)); |
| 115 case WebGLExtension::OESElementIndexUintName: |
| 116 return DartOESElementIndexUint::toDart(static_cast<OESElementIndexUint*>
(extension)); |
108 case WebGLExtension::WebGLDebugRendererInfoName: | 117 case WebGLExtension::WebGLDebugRendererInfoName: |
109 return DartWebGLDebugRendererInfo::toDart(static_cast<WebGLDebugRenderer
Info*>(extension)); | 118 return DartWebGLDebugRendererInfo::toDart(static_cast<WebGLDebugRenderer
Info*>(extension)); |
110 case WebGLExtension::WebGLDebugShadersName: | 119 case WebGLExtension::WebGLDebugShadersName: |
111 return DartWebGLDebugShaders::toDart(static_cast<WebGLDebugShaders*>(ext
ension)); | 120 return DartWebGLDebugShaders::toDart(static_cast<WebGLDebugShaders*>(ext
ension)); |
112 case WebGLExtension::WebGLCompressedTextureS3TCName: | 121 case WebGLExtension::WebGLCompressedTextureS3TCName: |
113 return DartWebGLCompressedTextureS3TC::toDart(static_cast<WebGLCompresse
dTextureS3TC*>(extension)); | 122 return DartWebGLCompressedTextureS3TC::toDart(static_cast<WebGLCompresse
dTextureS3TC*>(extension)); |
114 case WebGLExtension::WebGLDepthTextureName: | 123 case WebGLExtension::WebGLDepthTextureName: |
115 return DartWebGLDepthTexture::toDart(static_cast<WebGLDepthTexture*>(ext
ension)); | 124 return DartWebGLDepthTexture::toDart(static_cast<WebGLDepthTexture*>(ext
ension)); |
116 default: | |
117 ASSERT_NOT_REACHED(); | |
118 return 0; | |
119 } | 125 } |
| 126 |
| 127 ASSERT_NOT_REACHED(); |
| 128 return 0; |
120 } | 129 } |
121 | 130 |
122 static Dart_Handle webGLGetInfoToDart(const WebGLGetInfo& info) | 131 static Dart_Handle webGLGetInfoToDart(const WebGLGetInfo& info) |
123 { | 132 { |
124 switch (info.getType()) { | 133 switch (info.getType()) { |
125 case WebGLGetInfo::kTypeBool: | 134 case WebGLGetInfo::kTypeBool: |
126 return DartUtilities::boolToDart(info.getBool()); | 135 return DartUtilities::boolToDart(info.getBool()); |
127 case WebGLGetInfo::kTypeBoolArray: | 136 case WebGLGetInfo::kTypeBoolArray: |
128 return vectorToDart(info.getBoolArray()); | 137 return vectorToDart(info.getBoolArray()); |
129 case WebGLGetInfo::kTypeFloat: | 138 case WebGLGetInfo::kTypeFloat: |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 void vertexAttrib4fvCallback(Dart_NativeArguments args) | 748 void vertexAttrib4fvCallback(Dart_NativeArguments args) |
740 { | 749 { |
741 vertexAttribAndUniformHelperf(args, kVertexAttrib4v); | 750 vertexAttribAndUniformHelperf(args, kVertexAttrib4v); |
742 } | 751 } |
743 | 752 |
744 } | 753 } |
745 | 754 |
746 } | 755 } |
747 | 756 |
748 #endif // ENABLE(WEBGL) | 757 #endif // ENABLE(WEBGL) |
OLD | NEW |