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