| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Apple Inc. 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 static ImageData* create(DOMUint8ClampedArray*, unsigned width, unsigned hei
ght, ExceptionState&); | 52 static ImageData* create(DOMUint8ClampedArray*, unsigned width, unsigned hei
ght, ExceptionState&); |
| 53 | 53 |
| 54 IntSize size() const { return m_size; } | 54 IntSize size() const { return m_size; } |
| 55 int width() const { return m_size.width(); } | 55 int width() const { return m_size.width(); } |
| 56 int height() const { return m_size.height(); } | 56 int height() const { return m_size.height(); } |
| 57 const DOMUint8ClampedArray* data() const { return m_data.get(); } | 57 const DOMUint8ClampedArray* data() const { return m_data.get(); } |
| 58 DOMUint8ClampedArray* data() { return m_data.get(); } | 58 DOMUint8ClampedArray* data() { return m_data.get(); } |
| 59 | 59 |
| 60 // ImageBitmapSource implementation | 60 // ImageBitmapSource implementation |
| 61 IntSize bitmapSourceSize() const override { return m_size; } | 61 IntSize bitmapSourceSize() const override { return m_size; } |
| 62 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy,
int sw, int sh, const ImageBitmapOptions&, ExceptionState&) override; | 62 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, Optional<IntRect
> cropRect, const ImageBitmapOptions&, ExceptionState&) override; |
| 63 | 63 |
| 64 DEFINE_INLINE_TRACE() | 64 DEFINE_INLINE_TRACE() |
| 65 { | 65 { |
| 66 visitor->trace(m_data); | 66 visitor->trace(m_data); |
| 67 } | 67 } |
| 68 | 68 |
| 69 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) override WARN_UNUSED_RETURN; | 69 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) override WARN_UNUSED_RETURN; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 ImageData(const IntSize&, DOMUint8ClampedArray*); | 72 ImageData(const IntSize&, DOMUint8ClampedArray*); |
| 73 | 73 |
| 74 static bool validateConstructorArguments(DOMUint8ClampedArray*, unsigned wid
th, unsigned&, ExceptionState&); | 74 static bool validateConstructorArguments(DOMUint8ClampedArray*, unsigned wid
th, unsigned&, ExceptionState&); |
| 75 | 75 |
| 76 IntSize m_size; | 76 IntSize m_size; |
| 77 Member<DOMUint8ClampedArray> m_data; | 77 Member<DOMUint8ClampedArray> m_data; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| 81 | 81 |
| 82 #endif // ImageData_h | 82 #endif // ImageData_h |
| OLD | NEW |