| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 IntSize size() const; | 49 IntSize size() const; |
| 50 | 50 |
| 51 bool isNeutered() const { return m_isNeutered; } | 51 bool isNeutered() const { return m_isNeutered; } |
| 52 bool originClean() const { return m_image->originClean(); } | 52 bool originClean() const { return m_image->originClean(); } |
| 53 PassRefPtr<StaticBitmapImage> transfer(); | 53 PassRefPtr<StaticBitmapImage> transfer(); |
| 54 void close(); | 54 void close(); |
| 55 | 55 |
| 56 ~ImageBitmap() override; | 56 ~ImageBitmap() override; |
| 57 | 57 |
| 58 // CanvasImageSource implementation | 58 // CanvasImageSource implementation |
| 59 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason) const override; | 59 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const override; |
| 60 bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_image->ori
ginClean(); } | 60 bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_image->ori
ginClean(); } |
| 61 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override; | 61 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override; |
| 62 FloatSize elementSize() const override; | 62 FloatSize elementSize(const FloatSize&) const override; |
| 63 | 63 |
| 64 // ImageBitmapSource implementation | 64 // ImageBitmapSource implementation |
| 65 IntSize bitmapSourceSize() const override { return size(); } | 65 IntSize bitmapSourceSize() const override { return size(); } |
| 66 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy,
int sw, int sh, const ImageBitmapOptions&, ExceptionState&) override; | 66 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy,
int sw, int sh, const ImageBitmapOptions&, ExceptionState&) override; |
| 67 | 67 |
| 68 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 ImageBitmap(HTMLImageElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); | 71 ImageBitmap(HTMLImageElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); |
| 72 ImageBitmap(HTMLVideoElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); | 72 ImageBitmap(HTMLVideoElement*, const IntRect&, Document*, const ImageBitmapO
ptions&); |
| 73 ImageBitmap(HTMLCanvasElement*, const IntRect&, const ImageBitmapOptions&); | 73 ImageBitmap(HTMLCanvasElement*, const IntRect&, const ImageBitmapOptions&); |
| 74 ImageBitmap(ImageData*, const IntRect&, const ImageBitmapOptions&); | 74 ImageBitmap(ImageData*, const IntRect&, const ImageBitmapOptions&); |
| 75 ImageBitmap(ImageBitmap*, const IntRect&, const ImageBitmapOptions&); | 75 ImageBitmap(ImageBitmap*, const IntRect&, const ImageBitmapOptions&); |
| 76 ImageBitmap(PassRefPtr<StaticBitmapImage>); | 76 ImageBitmap(PassRefPtr<StaticBitmapImage>); |
| 77 ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&, const ImageBitmap
Options&); | 77 ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&, const ImageBitmap
Options&); |
| 78 | 78 |
| 79 // ImageLoaderClient | 79 // ImageLoaderClient |
| 80 void notifyImageSourceChanged() override; | 80 void notifyImageSourceChanged() override; |
| 81 bool requestsHighLiveResourceCachePriority() override { return true; } | 81 bool requestsHighLiveResourceCachePriority() override { return true; } |
| 82 | 82 |
| 83 RefPtr<StaticBitmapImage> m_image; | 83 RefPtr<StaticBitmapImage> m_image; |
| 84 bool m_isNeutered = false; | 84 bool m_isNeutered = false; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace blink | 87 } // namespace blink |
| 88 | 88 |
| 89 #endif // ImageBitmap_h | 89 #endif // ImageBitmap_h |
| OLD | NEW |