| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ImageBitmap_h | 5 #ifndef ImageBitmap_h |
| 6 #define ImageBitmap_h | 6 #define ImageBitmap_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/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 PassRefPtr<StaticBitmapImage> transfer(); | 54 PassRefPtr<StaticBitmapImage> transfer(); |
| 55 void close(); | 55 void close(); |
| 56 | 56 |
| 57 ~ImageBitmap() override; | 57 ~ImageBitmap() override; |
| 58 | 58 |
| 59 // CanvasImageSource implementation | 59 // CanvasImageSource implementation |
| 60 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const override; | 60 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const override; |
| 61 bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_image->ori
ginClean(); } | 61 bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_image->ori
ginClean(); } |
| 62 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override; | 62 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override; |
| 63 FloatSize elementSize(const FloatSize&) const override; | 63 FloatSize elementSize(const FloatSize&) const override; |
| 64 bool isImageBitmap() const override { return true; } |
| 64 | 65 |
| 65 // ImageBitmapSource implementation | 66 // ImageBitmapSource implementation |
| 66 IntSize bitmapSourceSize() const override { return size(); } | 67 IntSize bitmapSourceSize() const override { return size(); } |
| 67 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy,
int sw, int sh, const ImageBitmapOptions&, ExceptionState&) override; | 68 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy,
int sw, int sh, const ImageBitmapOptions&, ExceptionState&) override; |
| 68 | 69 |
| 69 DECLARE_VIRTUAL_TRACE(); | 70 DECLARE_VIRTUAL_TRACE(); |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 ImageBitmap(HTMLImageElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); | 73 ImageBitmap(HTMLImageElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); |
| 73 ImageBitmap(HTMLVideoElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); | 74 ImageBitmap(HTMLVideoElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); |
| 74 ImageBitmap(HTMLCanvasElement*, const IntRect&, const ImageBitmapOptions&); | 75 ImageBitmap(HTMLCanvasElement*, const IntRect&, const ImageBitmapOptions&); |
| 75 ImageBitmap(ImageData*, const IntRect&, const ImageBitmapOptions&, const boo
l&); | 76 ImageBitmap(ImageData*, const IntRect&, const ImageBitmapOptions&, const boo
l&); |
| 76 ImageBitmap(ImageBitmap*, const IntRect&, const ImageBitmapOptions&); | 77 ImageBitmap(ImageBitmap*, const IntRect&, const ImageBitmapOptions&); |
| 77 ImageBitmap(PassRefPtr<StaticBitmapImage>); | 78 ImageBitmap(PassRefPtr<StaticBitmapImage>); |
| 78 ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&, const ImageBitmap
Options&); | 79 ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&, const ImageBitmap
Options&); |
| 79 | 80 |
| 80 void parseOptions(const ImageBitmapOptions&, bool&, bool&); | 81 void parseOptions(const ImageBitmapOptions&, bool&, bool&); |
| 81 | 82 |
| 82 RefPtr<StaticBitmapImage> m_image; | 83 RefPtr<StaticBitmapImage> m_image; |
| 83 bool m_isNeutered = false; | 84 bool m_isNeutered = false; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace blink | 87 } // namespace blink |
| 87 | 88 |
| 88 #endif // ImageBitmap_h | 89 #endif // ImageBitmap_h |
| OLD | NEW |