| OLD | NEW |
| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 using TypedArrayBase<float>::set; | 43 using TypedArrayBase<float>::set; |
| 44 | 44 |
| 45 void set(unsigned index, double value) | 45 void set(unsigned index, double value) |
| 46 { | 46 { |
| 47 if (index >= TypedArrayBase<float>::m_length) | 47 if (index >= TypedArrayBase<float>::m_length) |
| 48 return; | 48 return; |
| 49 TypedArrayBase<float>::data()[index] = static_cast<float>(value); | 49 TypedArrayBase<float>::data()[index] = static_cast<float>(value); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual ViewType type() const override | 52 ViewType type() const override |
| 53 { | 53 { |
| 54 return TypeFloat32; | 54 return TypeFloat32; |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 inline Float32Array(PassRefPtr<ArrayBuffer>, | 58 inline Float32Array(PassRefPtr<ArrayBuffer>, |
| 59 unsigned byteOffset, | 59 unsigned byteOffset, |
| 60 unsigned length); | 60 unsigned length); |
| 61 // Make constructor visible to superclass. | 61 // Make constructor visible to superclass. |
| 62 friend class TypedArrayBase<float>; | 62 friend class TypedArrayBase<float>; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 85 Float32Array::Float32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset,
unsigned length) | 85 Float32Array::Float32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset,
unsigned length) |
| 86 : TypedArrayBase<float>(buffer, byteOffset, length) | 86 : TypedArrayBase<float>(buffer, byteOffset, length) |
| 87 { | 87 { |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace WTF | 90 } // namespace WTF |
| 91 | 91 |
| 92 using WTF::Float32Array; | 92 using WTF::Float32Array; |
| 93 | 93 |
| 94 #endif // Float32Array_h | 94 #endif // Float32Array_h |
| OLD | NEW |