OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 Float32ImageData_h | 5 #ifndef Float32ImageData_h |
6 #define Float32ImageData_h | 6 #define Float32ImageData_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/dom/DOMTypedArray.h" | 10 #include "core/dom/DOMTypedArray.h" |
11 #include "core/html/ImageData.h" | 11 #include "core/html/ImageData.h" |
12 #include "core/imagebitmap/ImageBitmapSource.h" | 12 #include "core/imagebitmap/ImageBitmapSource.h" |
13 #include "platform/geometry/IntRect.h" | 13 #include "platform/geometry/IntRect.h" |
14 #include "platform/geometry/IntSize.h" | 14 #include "platform/geometry/IntSize.h" |
15 #include "platform/heap/Handle.h" | 15 #include "platform/heap/Handle.h" |
16 #include "wtf/Compiler.h" | 16 #include "wtf/Compiler.h" |
17 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class ExceptionState; | 21 class ExceptionState; |
22 | 22 |
23 class CORE_EXPORT Float32ImageData final | 23 class CORE_EXPORT Float32ImageData final |
24 : public GarbageCollectedFinalized<Float32ImageData>, | 24 : public GarbageCollected<Float32ImageData>, |
25 public ScriptWrappable { | 25 public ScriptWrappable { |
26 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
27 | 27 |
28 public: | 28 public: |
29 static Float32ImageData* create(const IntSize&); | 29 static Float32ImageData* create(const IntSize&); |
30 static Float32ImageData* create(const IntSize&, DOMFloat32Array*); | 30 static Float32ImageData* create(const IntSize&, DOMFloat32Array*); |
31 static Float32ImageData* create(unsigned width, | 31 static Float32ImageData* create(unsigned width, |
32 unsigned height, | 32 unsigned height, |
33 ExceptionState&); | 33 ExceptionState&); |
34 static Float32ImageData* create(unsigned width, | 34 static Float32ImageData* create(unsigned width, |
(...skipping 17 matching lines...) Expand all Loading... |
52 String colorSpace, | 52 String colorSpace, |
53 ExceptionState&); | 53 ExceptionState&); |
54 | 54 |
55 IntSize size() const { return m_size; } | 55 IntSize size() const { return m_size; } |
56 int width() const { return m_size.width(); } | 56 int width() const { return m_size.width(); } |
57 int height() const { return m_size.height(); } | 57 int height() const { return m_size.height(); } |
58 String colorSpace() const { | 58 String colorSpace() const { |
59 return ImageData::getImageDataColorSpaceName(m_colorSpace); | 59 return ImageData::getImageDataColorSpaceName(m_colorSpace); |
60 } | 60 } |
61 ImageDataColorSpace imageDataColorSpace() { return m_colorSpace; } | 61 ImageDataColorSpace imageDataColorSpace() { return m_colorSpace; } |
62 const DOMFloat32Array* data() const { return m_data.get(); } | 62 const DOMFloat32Array* data() const { return m_data; } |
63 DOMFloat32Array* data() { return m_data.get(); } | 63 DOMFloat32Array* data() { return m_data; } |
64 | 64 |
65 DEFINE_INLINE_TRACE() { visitor->trace(m_data); } | 65 DEFINE_INLINE_TRACE() { visitor->trace(m_data); } |
66 | 66 |
67 WARN_UNUSED_RESULT v8::Local<v8::Object> associateWithWrapper( | 67 WARN_UNUSED_RESULT v8::Local<v8::Object> associateWithWrapper( |
68 v8::Isolate*, | 68 v8::Isolate*, |
69 const WrapperTypeInfo*, | 69 const WrapperTypeInfo*, |
70 v8::Local<v8::Object> wrapper) override; | 70 v8::Local<v8::Object> wrapper) override; |
71 | 71 |
72 private: | 72 private: |
73 Float32ImageData(const IntSize&, | 73 Float32ImageData(const IntSize&, |
(...skipping 13 matching lines...) Expand all Loading... |
87 ExceptionState* = nullptr); | 87 ExceptionState* = nullptr); |
88 | 88 |
89 static DOMFloat32Array* allocateAndValidateFloat32Array( | 89 static DOMFloat32Array* allocateAndValidateFloat32Array( |
90 const unsigned&, | 90 const unsigned&, |
91 ExceptionState* = nullptr); | 91 ExceptionState* = nullptr); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace blink | 94 } // namespace blink |
95 | 95 |
96 #endif // Float32ImageData_h | 96 #endif // Float32ImageData_h |
OLD | NEW |