| 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 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 static ImageBitmap* create(HTMLImageElement*, const IntRect&, Document*, con
st ImageBitmapOptions& = ImageBitmapOptions()); | 36 static ImageBitmap* create(HTMLImageElement*, const IntRect&, Document*, con
st ImageBitmapOptions& = ImageBitmapOptions()); |
| 37 static ImageBitmap* create(HTMLVideoElement*, const IntRect&, Document*, con
st ImageBitmapOptions& = ImageBitmapOptions()); | 37 static ImageBitmap* create(HTMLVideoElement*, const IntRect&, Document*, con
st ImageBitmapOptions& = ImageBitmapOptions()); |
| 38 static ImageBitmap* create(HTMLCanvasElement*, const IntRect&, const ImageBi
tmapOptions& = ImageBitmapOptions()); | 38 static ImageBitmap* create(HTMLCanvasElement*, const IntRect&, const ImageBi
tmapOptions& = ImageBitmapOptions()); |
| 39 static ImageBitmap* create(ImageData*, const IntRect&, const ImageBitmapOpti
ons& = ImageBitmapOptions(), const bool& isImageDataPremultiplied = false); | 39 static ImageBitmap* create(ImageData*, const IntRect&, const ImageBitmapOpti
ons& = ImageBitmapOptions(), const bool& isImageDataPremultiplied = false); |
| 40 static ImageBitmap* create(ImageBitmap*, const IntRect&, const ImageBitmapOp
tions& = ImageBitmapOptions()); | 40 static ImageBitmap* create(ImageBitmap*, const IntRect&, const ImageBitmapOp
tions& = ImageBitmapOptions()); |
| 41 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); | 41 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>); |
| 42 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, const IntRect&, co
nst ImageBitmapOptions& = ImageBitmapOptions()); | 42 static ImageBitmap* create(PassRefPtr<StaticBitmapImage>, const IntRect&, co
nst ImageBitmapOptions& = ImageBitmapOptions()); |
| 43 static PassRefPtr<SkImage> getSkImageFromDecoder(PassOwnPtr<ImageDecoder>); | 43 static PassRefPtr<SkImage> getSkImageFromDecoder(PassOwnPtr<ImageDecoder>); |
| 44 | 44 |
| 45 // Type and helper function required by CallbackPromiseAdapter: |
| 46 using WebType = OwnPtr<SkBitmap>; |
| 47 static ImageBitmap* take(ScriptPromiseResolver*, PassOwnPtr<SkBitmap>); |
| 48 |
| 45 StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() :
nullptr; } | 49 StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() :
nullptr; } |
| 46 PassOwnPtr<uint8_t[]> copyBitmapData(AlphaDisposition alphaOp = DontPremulti
plyAlpha); | 50 PassOwnPtr<uint8_t[]> copyBitmapData(AlphaDisposition alphaOp = DontPremulti
plyAlpha); |
| 47 unsigned long width() const; | 51 unsigned long width() const; |
| 48 unsigned long height() const; | 52 unsigned long height() const; |
| 49 IntSize size() const; | 53 IntSize size() const; |
| 50 | 54 |
| 51 bool isNeutered() const { return m_isNeutered; } | 55 bool isNeutered() const { return m_isNeutered; } |
| 52 bool originClean() const { return m_image->originClean(); } | 56 bool originClean() const { return m_image->originClean(); } |
| 53 bool isPremultiplied() const { return m_image->isPremultiplied(); } | 57 bool isPremultiplied() const { return m_image->isPremultiplied(); } |
| 54 PassRefPtr<StaticBitmapImage> transfer(); | 58 PassRefPtr<StaticBitmapImage> transfer(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 | 83 |
| 80 void parseOptions(const ImageBitmapOptions&, bool&, bool&); | 84 void parseOptions(const ImageBitmapOptions&, bool&, bool&); |
| 81 | 85 |
| 82 RefPtr<StaticBitmapImage> m_image; | 86 RefPtr<StaticBitmapImage> m_image; |
| 83 bool m_isNeutered = false; | 87 bool m_isNeutered = false; |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace blink | 90 } // namespace blink |
| 87 | 91 |
| 88 #endif // ImageBitmap_h | 92 #endif // ImageBitmap_h |
| OLD | NEW |