| Index: third_party/WebKit/Source/core/html/Float32ImageData.h
|
| diff --git a/third_party/WebKit/Source/core/html/ImageData.h b/third_party/WebKit/Source/core/html/Float32ImageData.h
|
| similarity index 56%
|
| copy from third_party/WebKit/Source/core/html/ImageData.h
|
| copy to third_party/WebKit/Source/core/html/Float32ImageData.h
|
| index 206671a1b48fba1f7b1937dc4cb78414fcb93f8b..04cad24851c3c3fc9e3599b88ea1d68820aeb5d5 100644
|
| --- a/third_party/WebKit/Source/core/html/ImageData.h
|
| +++ b/third_party/WebKit/Source/core/html/Float32ImageData.h
|
| @@ -26,45 +26,63 @@
|
| * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef ImageData_h
|
| -#define ImageData_h
|
| +#ifndef Float32ImageData_h
|
| +#define Float32ImageData_h
|
|
|
| #include "bindings/core/v8/ScriptWrappable.h"
|
| #include "core/CoreExport.h"
|
| #include "core/dom/DOMTypedArray.h"
|
| +#include "core/html/ImageData.h"
|
| #include "core/imagebitmap/ImageBitmapSource.h"
|
| #include "platform/geometry/IntRect.h"
|
| #include "platform/geometry/IntSize.h"
|
| #include "platform/heap/Handle.h"
|
| #include "wtf/Compiler.h"
|
| +#include "wtf/text/WTFString.h"
|
|
|
| namespace blink {
|
|
|
| class ExceptionState;
|
| class ImageBitmapOptions;
|
|
|
| -class CORE_EXPORT ImageData final : public GarbageCollectedFinalized<ImageData>,
|
| - public ScriptWrappable,
|
| - public ImageBitmapSource {
|
| +class CORE_EXPORT Float32ImageData final
|
| + : public GarbageCollectedFinalized<Float32ImageData>,
|
| + public ScriptWrappable,
|
| + public ImageBitmapSource {
|
| DEFINE_WRAPPERTYPEINFO();
|
|
|
| public:
|
| - static ImageData* create(const IntSize&);
|
| - static ImageData* create(const IntSize&, DOMUint8ClampedArray*);
|
| - static ImageData* create(unsigned width, unsigned height, ExceptionState&);
|
| - static ImageData* create(DOMUint8ClampedArray*,
|
| - unsigned width,
|
| - ExceptionState&);
|
| - static ImageData* create(DOMUint8ClampedArray*,
|
| - unsigned width,
|
| - unsigned height,
|
| - ExceptionState&);
|
| + static Float32ImageData* create(const IntSize&);
|
| + static Float32ImageData* create(const IntSize&, DOMFloat32Array*);
|
| + static Float32ImageData* create(unsigned width,
|
| + unsigned height,
|
| + ExceptionState&);
|
| + static Float32ImageData* create(unsigned width,
|
| + unsigned height,
|
| + String colorSpace,
|
| + ExceptionState&);
|
| + static Float32ImageData* create(DOMFloat32Array*,
|
| + unsigned width,
|
| + ExceptionState&);
|
| + static Float32ImageData* create(DOMFloat32Array*,
|
| + unsigned width,
|
| + unsigned height,
|
| + ExceptionState&);
|
| + static Float32ImageData* create(DOMFloat32Array*,
|
| + unsigned width,
|
| + unsigned height,
|
| + String colorSpace,
|
| + ExceptionState&);
|
|
|
| IntSize size() const { return m_size; }
|
| int width() const { return m_size.width(); }
|
| int height() const { return m_size.height(); }
|
| - const DOMUint8ClampedArray* data() const { return m_data.get(); }
|
| - DOMUint8ClampedArray* data() { return m_data.get(); }
|
| + String colorSpace() const {
|
| + return ImageData::getImageDataColorSpaceName(m_colorSpace);
|
| + }
|
| + ImageDataColorSpace imageDataColorSpace() { return m_colorSpace; }
|
| + const DOMFloat32Array* data() const { return m_data.get(); }
|
| + DOMFloat32Array* data() { return m_data.get(); }
|
|
|
| // ImageBitmapSource implementation
|
| IntSize bitmapSourceSize() const override { return m_size; }
|
| @@ -82,17 +100,25 @@ class CORE_EXPORT ImageData final : public GarbageCollectedFinalized<ImageData>,
|
| v8::Local<v8::Object> wrapper) override;
|
|
|
| private:
|
| - ImageData(const IntSize&, DOMUint8ClampedArray*);
|
| + Float32ImageData(const IntSize&,
|
| + DOMFloat32Array*,
|
| + String = kLegacyImageDataColorSpaceName);
|
|
|
| - static bool validateConstructorArguments(DOMUint8ClampedArray*,
|
| + static bool validateConstructorArguments(DOMFloat32Array*,
|
| unsigned width,
|
| unsigned&,
|
| ExceptionState&);
|
| + static bool validateConstructorArguments(DOMFloat32Array*,
|
| + unsigned width,
|
| + unsigned&,
|
| + String,
|
| + ExceptionState&);
|
|
|
| IntSize m_size;
|
| - Member<DOMUint8ClampedArray> m_data;
|
| + ImageDataColorSpace m_colorSpace;
|
| + Member<DOMFloat32Array> m_data;
|
| };
|
|
|
| } // namespace blink
|
|
|
| -#endif // ImageData_h
|
| +#endif // Float32ImageData_h
|
|
|