| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ColorSpaceInfoUpdate = DontUpdateColorSpaceInformation); | 93 ColorSpaceInfoUpdate = DontUpdateColorSpaceInformation); |
| 94 static bool isResizeOptionValid(const ImageBitmapOptions&, ExceptionState&); | 94 static bool isResizeOptionValid(const ImageBitmapOptions&, ExceptionState&); |
| 95 static bool isSourceSizeValid(int sourceWidth, | 95 static bool isSourceSizeValid(int sourceWidth, |
| 96 int sourceHeight, | 96 int sourceHeight, |
| 97 ExceptionState&); | 97 ExceptionState&); |
| 98 | 98 |
| 99 // Type and helper function required by CallbackPromiseAdapter: | 99 // Type and helper function required by CallbackPromiseAdapter: |
| 100 using WebType = sk_sp<SkImage>; | 100 using WebType = sk_sp<SkImage>; |
| 101 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>); | 101 static ImageBitmap* take(ScriptPromiseResolver*, sk_sp<SkImage>); |
| 102 | 102 |
| 103 StaticBitmapImage* bitmapImage() const { | 103 PassRefPtr<StaticBitmapImage> bitmapImage() const { return m_image; } |
| 104 return (m_image) ? m_image.get() : nullptr; | |
| 105 } | |
| 106 PassRefPtr<Uint8Array> copyBitmapData(AlphaDisposition = DontPremultiplyAlpha, | 104 PassRefPtr<Uint8Array> copyBitmapData(AlphaDisposition = DontPremultiplyAlpha, |
| 107 DataColorFormat = RGBAColorType); | 105 DataColorFormat = RGBAColorType); |
| 108 unsigned long width() const; | 106 unsigned long width() const; |
| 109 unsigned long height() const; | 107 unsigned long height() const; |
| 110 IntSize size() const; | 108 IntSize size() const; |
| 111 | 109 |
| 112 bool isNeutered() const { return m_isNeutered; } | 110 bool isNeutered() const { return m_isNeutered; } |
| 113 bool originClean() const { return m_image->originClean(); } | 111 bool originClean() const { return m_image->originClean(); } |
| 114 bool isPremultiplied() const { return m_image->isPremultiplied(); } | 112 bool isPremultiplied() const { return m_image->isPremultiplied(); } |
| 115 PassRefPtr<StaticBitmapImage> transfer(); | 113 PassRefPtr<StaticBitmapImage> transfer(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 bool isImageBitmapPremultiplied, | 164 bool isImageBitmapPremultiplied, |
| 167 bool isImageBitmapOriginClean); | 165 bool isImageBitmapOriginClean); |
| 168 | 166 |
| 169 RefPtr<StaticBitmapImage> m_image; | 167 RefPtr<StaticBitmapImage> m_image; |
| 170 bool m_isNeutered = false; | 168 bool m_isNeutered = false; |
| 171 }; | 169 }; |
| 172 | 170 |
| 173 } // namespace blink | 171 } // namespace blink |
| 174 | 172 |
| 175 #endif // ImageBitmap_h | 173 #endif // ImageBitmap_h |
| OLD | NEW |