Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/core/html/canvas/WebGLGetInfo.cpp

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/html/canvas/WebGLGetInfo.h" 28 #include "core/html/canvas/WebGLGetInfo.h"
29 29
30
31 namespace blink { 30 namespace blink {
32 31
33 WebGLGetInfo::WebGLGetInfo(bool value) 32 WebGLGetInfo::WebGLGetInfo(bool value)
34 : m_type(kTypeBool) 33 : m_type(kTypeBool)
35 , m_bool(value) 34 , m_bool(value)
36 , m_float(0) 35 , m_float(0)
37 , m_int(0) 36 , m_int(0)
38 , m_unsignedInt(0) 37 , m_unsignedInt(0)
39 { 38 {
40 } 39 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLBuffer> value) 101 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLBuffer> value)
103 : m_type(kTypeWebGLBuffer) 102 : m_type(kTypeWebGLBuffer)
104 , m_bool(false) 103 , m_bool(false)
105 , m_float(0) 104 , m_float(0)
106 , m_int(0) 105 , m_int(0)
107 , m_unsignedInt(0) 106 , m_unsignedInt(0)
108 , m_webglBuffer(value) 107 , m_webglBuffer(value)
109 { 108 {
110 } 109 }
111 110
112 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Float32Array> value) 111 WebGLGetInfo::WebGLGetInfo(PassRefPtr<DOMFloat32Array> value)
113 : m_type(kTypeWebGLFloatArray) 112 : m_type(kTypeWebGLFloatArray)
114 , m_bool(false) 113 , m_bool(false)
115 , m_float(0) 114 , m_float(0)
116 , m_int(0) 115 , m_int(0)
117 , m_unsignedInt(0) 116 , m_unsignedInt(0)
118 , m_webglFloatArray(value) 117 , m_webglFloatArray(value)
119 { 118 {
120 } 119 }
121 120
122 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLFramebuffer> value) 121 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLFramebuffer> value)
123 : m_type(kTypeWebGLFramebuffer) 122 : m_type(kTypeWebGLFramebuffer)
124 , m_bool(false) 123 , m_bool(false)
125 , m_float(0) 124 , m_float(0)
126 , m_int(0) 125 , m_int(0)
127 , m_unsignedInt(0) 126 , m_unsignedInt(0)
128 , m_webglFramebuffer(value) 127 , m_webglFramebuffer(value)
129 { 128 {
130 } 129 }
131 130
132 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Int32Array> value) 131 WebGLGetInfo::WebGLGetInfo(PassRefPtr<DOMInt32Array> value)
133 : m_type(kTypeWebGLIntArray) 132 : m_type(kTypeWebGLIntArray)
134 , m_bool(false) 133 , m_bool(false)
135 , m_float(0) 134 , m_float(0)
136 , m_int(0) 135 , m_int(0)
137 , m_unsignedInt(0) 136 , m_unsignedInt(0)
138 , m_webglIntArray(value) 137 , m_webglIntArray(value)
139 { 138 {
140 } 139 }
141 140
142 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLProgram> value) 141 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLProgram> value)
(...skipping 19 matching lines...) Expand all
162 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLTexture> value) 161 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLTexture> value)
163 : m_type(kTypeWebGLTexture) 162 : m_type(kTypeWebGLTexture)
164 , m_bool(false) 163 , m_bool(false)
165 , m_float(0) 164 , m_float(0)
166 , m_int(0) 165 , m_int(0)
167 , m_unsignedInt(0) 166 , m_unsignedInt(0)
168 , m_webglTexture(value) 167 , m_webglTexture(value)
169 { 168 {
170 } 169 }
171 170
172 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Uint8Array> value) 171 WebGLGetInfo::WebGLGetInfo(PassRefPtr<DOMUint8Array> value)
173 : m_type(kTypeWebGLUnsignedByteArray) 172 : m_type(kTypeWebGLUnsignedByteArray)
174 , m_bool(false) 173 , m_bool(false)
175 , m_float(0) 174 , m_float(0)
176 , m_int(0) 175 , m_int(0)
177 , m_unsignedInt(0) 176 , m_unsignedInt(0)
178 , m_webglUnsignedByteArray(value) 177 , m_webglUnsignedByteArray(value)
179 { 178 {
180 } 179 }
181 180
182 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Uint32Array> value) 181 WebGLGetInfo::WebGLGetInfo(PassRefPtr<DOMUint32Array> value)
183 : m_type(kTypeWebGLUnsignedIntArray) 182 : m_type(kTypeWebGLUnsignedIntArray)
184 , m_bool(false) 183 , m_bool(false)
185 , m_float(0) 184 , m_float(0)
186 , m_int(0) 185 , m_int(0)
187 , m_unsignedInt(0) 186 , m_unsignedInt(0)
188 , m_webglUnsignedIntArray(value) 187 , m_webglUnsignedIntArray(value)
189 { 188 {
190 } 189 }
191 190
192 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> val ue) 191 WebGLGetInfo::WebGLGetInfo(PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> val ue)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 ASSERT(getType() == kTypeUnsignedInt); 238 ASSERT(getType() == kTypeUnsignedInt);
240 return m_unsignedInt; 239 return m_unsignedInt;
241 } 240 }
242 241
243 PassRefPtrWillBeRawPtr<WebGLBuffer> WebGLGetInfo::getWebGLBuffer() const 242 PassRefPtrWillBeRawPtr<WebGLBuffer> WebGLGetInfo::getWebGLBuffer() const
244 { 243 {
245 ASSERT(getType() == kTypeWebGLBuffer); 244 ASSERT(getType() == kTypeWebGLBuffer);
246 return m_webglBuffer; 245 return m_webglBuffer;
247 } 246 }
248 247
249 PassRefPtr<Float32Array> WebGLGetInfo::getWebGLFloatArray() const 248 PassRefPtr<DOMFloat32Array> WebGLGetInfo::getWebGLFloatArray() const
250 { 249 {
251 ASSERT(getType() == kTypeWebGLFloatArray); 250 ASSERT(getType() == kTypeWebGLFloatArray);
252 return m_webglFloatArray; 251 return m_webglFloatArray;
253 } 252 }
254 253
255 PassRefPtrWillBeRawPtr<WebGLFramebuffer> WebGLGetInfo::getWebGLFramebuffer() con st 254 PassRefPtrWillBeRawPtr<WebGLFramebuffer> WebGLGetInfo::getWebGLFramebuffer() con st
256 { 255 {
257 ASSERT(getType() == kTypeWebGLFramebuffer); 256 ASSERT(getType() == kTypeWebGLFramebuffer);
258 return m_webglFramebuffer; 257 return m_webglFramebuffer;
259 } 258 }
260 259
261 PassRefPtr<Int32Array> WebGLGetInfo::getWebGLIntArray() const 260 PassRefPtr<DOMInt32Array> WebGLGetInfo::getWebGLIntArray() const
262 { 261 {
263 ASSERT(getType() == kTypeWebGLIntArray); 262 ASSERT(getType() == kTypeWebGLIntArray);
264 return m_webglIntArray; 263 return m_webglIntArray;
265 } 264 }
266 265
267 PassRefPtrWillBeRawPtr<WebGLProgram> WebGLGetInfo::getWebGLProgram() const 266 PassRefPtrWillBeRawPtr<WebGLProgram> WebGLGetInfo::getWebGLProgram() const
268 { 267 {
269 ASSERT(getType() == kTypeWebGLProgram); 268 ASSERT(getType() == kTypeWebGLProgram);
270 return m_webglProgram; 269 return m_webglProgram;
271 } 270 }
272 271
273 PassRefPtrWillBeRawPtr<WebGLRenderbuffer> WebGLGetInfo::getWebGLRenderbuffer() c onst 272 PassRefPtrWillBeRawPtr<WebGLRenderbuffer> WebGLGetInfo::getWebGLRenderbuffer() c onst
274 { 273 {
275 ASSERT(getType() == kTypeWebGLRenderbuffer); 274 ASSERT(getType() == kTypeWebGLRenderbuffer);
276 return m_webglRenderbuffer; 275 return m_webglRenderbuffer;
277 } 276 }
278 277
279 PassRefPtrWillBeRawPtr<WebGLTexture> WebGLGetInfo::getWebGLTexture() const 278 PassRefPtrWillBeRawPtr<WebGLTexture> WebGLGetInfo::getWebGLTexture() const
280 { 279 {
281 ASSERT(getType() == kTypeWebGLTexture); 280 ASSERT(getType() == kTypeWebGLTexture);
282 return m_webglTexture; 281 return m_webglTexture;
283 } 282 }
284 283
285 PassRefPtr<Uint8Array> WebGLGetInfo::getWebGLUnsignedByteArray() const 284 PassRefPtr<DOMUint8Array> WebGLGetInfo::getWebGLUnsignedByteArray() const
286 { 285 {
287 ASSERT(getType() == kTypeWebGLUnsignedByteArray); 286 ASSERT(getType() == kTypeWebGLUnsignedByteArray);
288 return m_webglUnsignedByteArray; 287 return m_webglUnsignedByteArray;
289 } 288 }
290 289
291 PassRefPtr<Uint32Array> WebGLGetInfo::getWebGLUnsignedIntArray() const 290 PassRefPtr<DOMUint32Array> WebGLGetInfo::getWebGLUnsignedIntArray() const
292 { 291 {
293 ASSERT(getType() == kTypeWebGLUnsignedIntArray); 292 ASSERT(getType() == kTypeWebGLUnsignedIntArray);
294 return m_webglUnsignedIntArray; 293 return m_webglUnsignedIntArray;
295 } 294 }
296 295
297 PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> WebGLGetInfo::getWebGLVertexAr rayObjectOES() const 296 PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> WebGLGetInfo::getWebGLVertexAr rayObjectOES() const
298 { 297 {
299 ASSERT(getType() == kTypeWebGLVertexArrayObjectOES); 298 ASSERT(getType() == kTypeWebGLVertexArrayObjectOES);
300 return m_webglVertexArrayObject; 299 return m_webglVertexArrayObject;
301 } 300 }
302 301
303 } // namespace blink 302 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLGetInfo.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698